I have installed rbenv using Homebrew.
$ rbenv local
2.4.0
$ rbenv global
2.4.0
$ ruby -v
ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-darwin16]
When I check the Rails version I get the following message;
Rails is not currently installed on this system. To get the latest version, simply type:
$ sudo gem install rails
You can then rerun your "rails" command.
I have been told not to install Rails using sudo, so I have tried running gem install rails
but it gives me the following error;
ERROR: While executing gem ... (Errno::EACCES)
Permission denied @ rb_sysopen - /Users/USER1/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/thread_safe-0.3.6/.rspec
Is it correct that I should not install rails with sudo, and if so how can I?