Rbenv: Ruby version not updated after install

Created on 15 Oct 2016  路  4Comments  路  Source: rbenv/rbenv

I'm on Mac OS Sierra. I ran the following:

brew install rbenv ruby-build

# Add rbenv to bash so that it loads every time you open a terminal
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile
source ~/.bash_profile

# Install Ruby
rbenv install 2.3.1
rbenv global 2.3.1
ruby -v

But, the output of ruby -v is ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16]

Can't figure out what went wrong. I tried to reinstall 2.3.1 and it said the version already existed. Ideas?

Most helpful comment

Open a new terminal window. Check echo $PATH. Does it include the directory ~/.rbenv/shims? If it doesn't, then check if you've added the rbenv init line to ~/.bash_profile, or to ~/.zshrc if you're running zsh.

When everything is setup correctly, which -a ruby should list ~/.rbenv/shims/ruby first (this is important), then /usr/bin/ruby (your system Ruby) second.

All 4 comments

Open a new terminal window. Check echo $PATH. Does it include the directory ~/.rbenv/shims? If it doesn't, then check if you've added the rbenv init line to ~/.bash_profile, or to ~/.zshrc if you're running zsh.

When everything is setup correctly, which -a ruby should list ~/.rbenv/shims/ruby first (this is important), then /usr/bin/ruby (your system Ruby) second.

Perfect, that fixed is. Thanks!

Remember to close the issue after your problem has been answered 馃槈

when i installed for some reason it did not updated by bash_profile.

i cannot stress how important it is to:

Edit your ~/.bash_profile and put

eval "$(rbenv init -)"

at the end

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bradrydzewski picture bradrydzewski  路  4Comments

sonnybrakes picture sonnybrakes  路  4Comments

ghost picture ghost  路  4Comments

slayer picture slayer  路  4Comments

mhinz picture mhinz  路  3Comments