0

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?

Cory L
  • 253
  • 1
  • 11
  • Possible duplicate of [Installed Rails but the rails command says it's not installed](https://stackoverflow.com/questions/1954015/installed-rails-but-the-rails-command-says-its-not-installed) – OneNeptune Jun 07 '17 at 01:47

1 Answers1

0

I installed RVM (requires download and use of GPG) and followed the steps on RVM's install page. Should you use sudo? I've read both ways. Here is the page link:

https://rvm.io/rvm/install

The command once RVM is installed:

\curl -sSL https://get.rvm.io | bash -s stable --rails

That will install the latest stable version of rails available. I did this as a complete novice and it has worked for me (as a slightly higher novice) so far.

AWHay
  • 1
  • 1