Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gem update/install operation not permitted since el capitan. how to set default path

Does anybody know why after updating to Mac OS El Capitan gem has started giving errors for install or update commands?

Example:


$ sudo gem update
Password:
Updating installed gems
Updating bundler
ERROR:  While executing gem ... (Errno::EPERM)
  Operation not permitted - /usr/bin/bundle

For some reason the path has to be set explicitly. Example:


$ sudo gem install -n /usr/local/bin sass
Password:
Fetching: sass-3.4.19.gem (100%)
Successfully installed sass-3.4.19
Parsing documentation for sass-3.4.19
Installing ri documentation for sass-3.4.19
Done installing documentation for sass after 6 seconds
1 gem installed

This is pretty annoying! Is there a way to make /usr/local/bin default?

like image 895
Kim Hogeling Avatar asked Feb 08 '23 19:02

Kim Hogeling


1 Answers

This is not directly answering your question, but since your accepted answer is a little dangerous, I would like to share how I solved the actual issue of not being able to install a gem.

In my case I was having a problem with compass and had the same error, which is what I entered in my search and Google brought me here. I ran

sudo gem install -n /usr/local/bin compass

But if you are doing a fresh install on a new computer. Make sure that you have bash installed. Here is a brief transcript of what I did.

enter image description here

like image 149
JGallardo Avatar answered May 01 '23 16:05

JGallardo