Reputation: 4546
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
Upvotes: 3
Views: 7250
Reputation: 7581
The reason of the error is because you are not logged in as the root user on terminal.
If you already have root use enable on your mac in terminal type (without the $)
$ su
If you dont have root user, you need to enable it using the following steps
More at the same on http://support.apple.com/kb/ht1528
Atleast it works for me after getting stuck for couple of hours.
Upvotes: 0
Reputation: 4934
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
Upvotes: 4
Reputation: 61437
If you aren't using a ruby version manager (like rvm or rbenv), you'll need to use sudo
to install on system-level.
Upvotes: 1