[英]Ruby version not update using rbenv on mac
我按照這個教程
安裝自制軟件
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
安裝紅寶石
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
但仍然輸出 ruby -v
ruby 2.0.0p648 (2015-12-16 修訂版 53162) [universal.x86_64-darwin16]
在 mac OS Sierra 10.12 上運行
安裝步驟之一是這樣的:
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile
.bash_profile
命令寫入您的.bash_profile
。
您需要重新啟動 Bash 會話(退出終端並打開一個新的)以使其生效。
我遇到了同樣的問題,在這里 [ https://github.com/rbenv/rbenv/issues/939][1]為我修復了 Mislav 的評論。
將eval "$(rbenv init -)"
行添加到您的.bash_profile
。
為我工作。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.