• Register
0 votes

Problem :

I am trying to install the gem using gem install mygem or update a RubyGems using gem update --system, and it fails with below error:

ERROR:  While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.

Does anyone have the idea how to fix this error?

7 5 2
3,870 points

1 Answer

0 votes

Solution :

“You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.”

The above error means exactly that, you don't have permission to write there. That is a version of Ruby installed by the Apple, for their own use. While it is OK to make the minor modifications to that if you really know what you are doing, as you are not sure about a permissions problem, I would say it is not the good idea to continue with that track.

Instead, I will strongly suggest you to look into it by using either rbenv or RVM to manage the separate Ruby, installed into the sandbox in the home directory, that you can modify/fold/spindle/change without ever worrying about the messing up a system Ruby.

Between the two, I use the rbenv, though I used a RVM a lot in a past. rbenv takes the more "hands-off" approach to managing the Ruby installation. RVM has the lot of features and is very powerful, but, as the result is more intrusive. In either case, need to READ the installation documentation for them for a couple times before starting to install whichever you want to pick.

9 7 4
38,600 points

Related questions

0 votes
1 answer 257 views
Problem : I want to run the specs, you will need to install RSpec. First, run the gem install bundler in a root directory of the project. Then, run the bundle install. To run the single spec file, run the command like below: bundle exec rspec spec/00_hello_spec.rb. To ... ruby, and I want to bundle install inside of the atom? Could anyone tell me how to use the atom or run anything in the atom?
asked Jan 22 jwilliam 3.9k points
0 votes
1 answer 7 views