• Register
0 votes

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 run all of a specs at once, run a bundle exec rspec.

So, I just typed gem install bundler to a terminal, and got below error 

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

And this was in a project file in a atom *source "https://rubygems.org" gem "rspec", "~> 3.2.0" *

So my question is:

It seems like a terminal is giving me a response because I am not supposed to change anything on a 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?

7 5 2
3,870 points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

If you don't want to run the sudo then install a ruby using homebrew

brew install ruby
export GEM_HOME="$HOME/.gem"
gem install rails

You may also want to add export GEM_HOME="$HOME/.gem" to the ~/.bash_profile or .zshrc if you're using the zsh


Worked for me by using a parameter --user-install running below command:

gem install name_of_gem --user-install

Then it started to fetch and installed it.

9 7 4
38,600 points

Related questions

0 votes
1 answer 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?
asked Jan 22, 2020 jwilliam 3.9k points
0 votes
1 answer 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 61 views
Problem : I am trying to execute the below script: gem install rdoc --no-document gem install bundle bundle I have already added /srv/myuser/.gem/ruby/2.5.0/bin to the path so I was able to install the gems. I can also find the bundle when I try to perform: ... appears while executing below commands : gem list bundle shows bundle (0.0.1) bundler (2.0.1) Does anyone have any solution on my issue?
asked Dec 21, 2019 alecxe 7.5k points
0 votes
1 answer 18 views
1 vote
2 answers 165 views
Problem : I am beginner to the monaca. Currently I am trying to install the monaca with the use of below command. npm install -g monaca But I am facing below errors after executing above command: npm WARN checkPermissions Missing write access to /usr/local/lib/ ... /lib/node_modules' } I am struggling with above error from past couple of days. Can somebody help me in fixing above monaca error?
asked Mar 27, 2020 morrisBson 3.2k points
0 votes
1 answer 61 views
Problem : I am getting bellow error while I'm trying to setup an Android dev environment on Mac error:buildtools 24.0.2 requires java 1.8 or above. current jdk version is 1.7.
asked Oct 19, 2019 peterlaw 6.9k points
0 votes
1 answer 36 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
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