Reputation: 9
As title
git:(master) ✗ gem install rails ERROR: While executing gem ... (Errno::EACCES) Permission denied @ rb_sysopen - /usr/local/lib/ruby/gems/2.4.0/gems/rails-5.1.4/README.md
git:(master) ✗ sudo gem install rails Successfully installed rails-5.1.4 Parsing documentation for rails-5.1.4 Done installing documentation for rails after 0 seconds 1 gem installed
~ git:(master) ✗ rails -v 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.
Upvotes: 0
Views: 368
Reputation: 4386
I would recommend you to use:
rbenv
for ruby installation
and only with it use gem install rails
Usually installing gems with sudo
is a bad idea, that brings a lot of problems with permissions.
Upvotes: 1