Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

install ruby gem (no write permissions)?

Tags:

ruby

rubygems

I get this error while trying to install sass Should I use sudo before the install statement?

rd-macbook-pro:~ redres$ gem install css_parser
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions into the /Library/Ruby/Gems/1.8 directory.
rd-macbook-pro:~ redres$ 

thanks, Rich

like image 650
Richard Avatar asked Sep 20 '26 16:09

Richard


2 Answers

Yes you can use sudo or set gem path

mkdir -p /Users/redres/.gem/ruby/1.8
export GEM_PATH=/Users/redres/.gem/ruby/1.8
export GEM_HOME=/Users/redres/.gem/ruby/1.8

but i highly recommend to try using RVM https://rvm.io/rvm/install/

curl -L https://get.rvm.io | bash -s stable

to install and

rvm requirements

to get further information

like image 129
Eugene Rourke Avatar answered Sep 22 '26 10:09

Eugene Rourke


If you aren't using a ruby version manager (like rvm or rbenv), you'll need to use sudo to install on system-level.

like image 26
Femaref Avatar answered Sep 22 '26 08:09

Femaref



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!