• Register
0 votes
191 views

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

Please log in or register to answer this question.

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 534 views
534 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, 2020 jwilliam 3.9k points
0 votes
1 answer 28 views
28 views
Problem: I am learning ruby and I have updated XCode on my Mac and since then when I run Docker using docker-sync-stack startI get the following error: mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/ ... :, brew install rbenv ruby-buildbut that doesn't change anything. Does anyone have idea how I should fix this? I will be thankful!
asked Dec 2, 2020 sasha 6.4k points
0 votes
1 answer 42 views
0 votes
1 answer 18 views
0 votes
1 answer 35 views
35 views
Problem: Hello Kodlogs, I tried pushing my app and I got an error message of this nature; you must use bundler 2 or greater with this lockfile. What can I do to correct this?
asked Nov 2, 2020 Festus James 360 points
0 votes
1 answer 6 views
6 views
Problem: Hello Kodlogs, I was working on an app I want to deploy for use within my business but I was faced with a hosting issue so I decided to fix it with Heroku using a custom domain and I got this error: installing doc 3.12.2 installing pg 0.15.1 an ... failed to install gems via bundler. ! ! detected sqlite3 gem which is not supported on heroku. ! ! push rejected, failed to compile ruby app
asked Jan 14 Festus James 360 points
0 votes
1 answer 14 views
14 views
Problem: Hello Kodlogs, I encountered a strange issue where vagrant works fine for a while and it completely stops working unexpectedly. Afterward, any of the vagrant commands I run just give me this error: "exec error: exec: "ruby": executable file not found in %PATH%"
asked Dec 29, 2020 Festus James 360 points
0 votes
1 answer 16 views
16 views
Problem: Hello Kodlogs, I tried installing Ruby with rbenv. I used homebrew to install rbenv ~ $ brew install rbenv That process was successful. Then I proceeded to install the ruby version of 2.6.1 in rbenv but it kept hanging on the following line. ~ $ rbenv install 2.6. ... .tar.bz2 Installing ruby-2.6.1... ruby-build: use readline from homebrew I think it's stuck, can someone help me fix this?
asked Dec 29, 2020 Festus James 360 points
0 votes
1 answer 10 views
10 views
Problem: Hello Kodlogs, I tried running this command on my app $ Heroku run bash ~$ rails c But it didn't come out well as this error was displayed Could not find rake-12.0.0 in any of the sources Run bundle installs to install missing gems.
asked Dec 27, 2020 Festus James 360 points