Could somebody tell me how to install the latest version of Ruby? I've done
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' >> ~/.zshrc
source ~/.zshrc
# Install Ruby
rbenv install 2.7.2
rbenv global 2.7.2
ruby -v
Besides while I'm running ruby -v
:
ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]
Instead of 2.7.2. What have I missed?
Thanks
Try which ruby
and see what comes up. If it's the system ruby and not the rbenv one, you need to add this to your profile:
export PATH="$HOME/.rbenv/shims:$PATH"
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.