简体   繁体   中英

Ruby version not update using rbenv on mac

I follow this tutorial

Install homebrew

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install Ruby

brew install rbenv ruby-build
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile
rbenv install 2.4.0
rbenv global 2.4.0
ruby -v

but output ruby -v still

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

running on mac OS Sierra 10.12

One of the steps of the installation is this one:

echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile

Which writes a command into your .bash_profile .

You need to restart your Bash session (quit the Terminal and open a new one) to take it into effect.

我遇到了同样的问题,在这里 [ https://github.com/rbenv/rbenv/issues/939][1]为我修复了 Mislav 的评论。

Add eval "$(rbenv init -)" line to your .bash_profile .

Works for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM