Operation not permitted - /usr/bin/update_rubygems

When I execute on osx El Capitan:

sudo gem update --system  

I got the error:

Updating rubygems-update
ERROR:  While executing gem ... (Errno::EPERM)
    Operation not permitted - /usr/bin/update_rubygems

ended up installing ruby via homebrew. Install homebrew first:

http://brew.sh

then execute

brew install ruby

after that it worked flawlessly. It has something to do with the native ruby installation.


If you're having issues installing a specific gem after installing ruby through Homebrew (as advised above), try the following:

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

Found this thanks to user endoplasmic on this issue thread: https://github.com/sass/sass/issues/1768