The update / install operation of gem is not allowed, as el capitan. how to set the default path

Does anyone know why, after upgrading to Mac OS, El Capitan gem started giving errors for commands installor update?

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 must 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 very annoying! Is there any way to do this /usr/local/binby default?

+4
source share
3 answers

Having the same problems, I found this:

  • Boot into Recovery HD by restarting it while holding the ⌘R button.
  • Open a terminal (from the Utilities menu).
  • Run the following command in terminal: csrutil disable
  • Restart

: https://georgegarside.com/blog/osx/package-incompatible-installer/

+2

, , , , .

, , Google .

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

. , bash. , .

enter image description here

+4

If you are using homegrown, there is another solution that you can try in the commands below. This is due to installing the home version of Ruby. This fixed the problem for me, although I know hard about Unix. Therefore, I can’t talk about how reasonable or unreasonable to own / usr / local. Maybe a Unix expert can listen here.

$ sudo chown -R $(whoami):admin /usr/local
$ brew update
$ brew install ruby

Source: http://www.hacksparrow.com/os-x-el-capitan-screwed-up-ruby-gems-and-how-to-fix-it.html

+2
source

Source: https://habr.com/ru/post/1611751/


All Articles