• Register
0 votes
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 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

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

 OR

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 151 views
151 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 jwilliam 3.9k points
0 votes
1 answer 41 views
41 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 7 views