曾濟彬
曾濟彬

Reputation: 9

Failed to install rails

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

Answers (1)

Stanislav Mekhonoshin
Stanislav Mekhonoshin

Reputation: 4386

I would recommend you to use:

  1. rbenv for ruby installation

  2. 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

Related Questions