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

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

 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 242 views
242 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
1 vote
1 answer 3 views
3 views
Problem : I got this error when installing Rubygem : rubygems.rb:289:in `find_spec_for_exe': can't find gem bundler (>= 0.a) with executable bundle (Gem::GemNotFoundException) I have no idea what to do next ?
asked Mar 31 Shovo210 13.3k points
0 votes
1 answer 105 views
105 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 16 views
16 views
Problem: Any ideas on what I need to do to fix this? Thanks!
asked Mar 7 Rohit kr 15.5k points
0 votes
1 answer 68 views
68 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 16.2k points
0 votes
1 answer 86 views
1 vote
1 answer 23 views
23 views
Problem: I need help understanding this error: the activity must be exported or contain an intent-filter. you don't have write permissions for the /usr/bin directory
asked Mar 6 MUHAMMAD MUNEEB 82.5k points
0 votes
1 answer 21 views
21 views
Problem: Can anyone fix this error: You don't have write permissions for the /usr/bin directory. Any ideas?
asked Mar 5 ummesalma 24.5k points
0 votes
1 answer 34 views