1

I upgraded ruby from 2.2.3 using rbenv following these instructions

$ brew update
$ brew install ruby-build
$ brew install rbenv
$ rbenv install 2.5.0
$ rbenv global 2.5.0
$ rbenv local 2.5.0

i restarted my terminal and my computer but when i run

ruby -v

it shows that i have

ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin14]

when i run rbenv version

  system
  2.4.0
  2.5.0 (set by /Users/****/.ruby-version)

it doesn't even show this version, i'm stuck on what i have to do to change this to point to the correct version.

When i run

$echo $PATH

it shows

-bash: /usr/local/opt/imagemagick@6/bin:/Users/****/.rvm/gems/ruby-2.2.3/bin:/Users/****/.rvm/gems/ruby-2.2.3@global/bin:/Users/****/.rvm/rubies/ruby-2.2.3/bin:/Users/****/anaconda/bin:/Library/Frameworks/Python.framework/Versions/3.4/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/****/.rvm/bin: No such file or directory
ricks
  • 3,154
  • 31
  • 51

1 Answers1

1

From your path, it looks like you are using rvm. I think rvm and rbenv should not be both active on the same system. If you are going to use rbenv I suggest you disable rvm. You don't need to delete the .rvm directory containing rvm's rubies, gems, etc., you just need to stop the rvm shell code from being loaded when the terminal window starts up. To do this, disable or remove the rvm-related code in your .bashrc, .profile, .bash_profile, .zshrc, etc., and use a new terminal window that starts up after that removal.

I suspect the 2.2.3 version of Ruby is the system you see in the list. If you do a which ruby, you can see where it's located, and that will be a clue; if it's /usr/bin/ruby, then it's the system Ruby.

As an aside, you can get a list of directories in the PATH one to a line by using this command:

echo $PATH | tr : \\n

This would be much easier to follow than the long line containing all the directories.

Keith Bennett
  • 4,722
  • 1
  • 25
  • 35
  • 1
    Thank you! i just figured this out i was about to post the answer, seems like i had originally installed it via RVM like you said and i tried upgrading it using rbenv so it was conflicting, i ended up deleting rvm and changing my bash_profile like this https://stackoverflow.com/questions/10940736/rbenv-not-changing-ruby-version suggested and it work – ricks Jan 23 '18 at 18:54