1

I have gone about the recommended way of installing a new version of Ruby on Mac OS X: Homebrew, and rvm. I ran rbenv to install Ruby 2.3.3, and selected it as the preferred version by using "rbenv global 2.3.3". The problem I am having is that there is currently a 2.0.0 version installed at /usr/bin/ruby, and for some crazy reason I am unable to remove it.

$ rbenv global
2.3.3

$ which ruby
/usr/bin/ruby

$ ruby -v
ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16]

$ ~/.rbenv/versions/2.3.3/bin/ruby -v
ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-darwin16]

sudo rm -rf /usr/bin/ruby
Password:
rm: /usr/bin/ruby: Operation not permitted

Argh!! Please help.

Casper
  • 33,403
  • 4
  • 84
  • 79
tinskip
  • 41
  • 3
  • Sorry for the crappy formatting of the command lines above. stackoverflow ate my newlines. – tinskip Nov 30 '16 at 07:48
  • Relevant: [Operation Not Permitted when on root El capitan (rootless disabled)](http://stackoverflow.com/questions/32659348/operation-not-permitted-when-on-root-el-capitan-rootless-disabled) – Amadan Nov 30 '16 at 07:49
  • 1
    Also, why would you mix `rvm` and `rbenv`? Pick one. Besides, Homebrew is required for `rvm` - but don't install `rvm` from Homebrew! Use the method their webpage tells you. – Amadan Nov 30 '16 at 07:50

1 Answers1

0

The problem is not your system Ruby, the problem is you probably didn't follow the rbenv installation instructions completely correctly.

The reason the system Ruby is located before your rbenv Ruby, is because your PATH has not been properly updated.

This explains why that is important:
https://github.com/rbenv/rbenv#understanding-path

To set up your PATH correctly you can read and complete steps 2-4 here:
https://github.com/rbenv/rbenv#basic-github-checkout

Casper
  • 33,403
  • 4
  • 84
  • 79