Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ruby version not updated after install #939

Closed
ponamute opened this issue Oct 14, 2016 · 4 comments
Closed

Ruby version not updated after install #939

ponamute opened this issue Oct 14, 2016 · 4 comments

Comments

@ponamute
Copy link

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?

@mislav
Copy link
Member

mislav commented Oct 14, 2016

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.

@ponamute
Copy link
Author

Perfect, that fixed is. Thanks!

@mislav
Copy link
Member

mislav commented Oct 17, 2016

Remember to close the issue after your problem has been answered 😉

@spencer1573
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants