mac 升級 ruby 版本

由于 mac pro 自身帶的ruby 版本是 2.0 ,算是比較低的了,現在 安裝使用一些 ruby 寫的工具 都要求 ruby的版本 是2.3 以上之類的,所以需要 更新 mac 上的ruby 版本。

參照 這篇 點贊最高的那個,
https://stackoverflow.com/questions/3696564/how-to-update-ruby-to-1-9-x-on-mac
但是其中我還是遇到了 一些小阻礙, 因為中間 要用到 homebrew 這玩意,這個東西 不讓在root 用戶下運行 ,而我安裝的rvm 工具是在 root 下 安裝的,所以 剛開始rvm 只能在root 下使用。這就矛盾了,為了
解開矛盾 就需要 使之 臣服,我選擇了 如果讓 rvm 在非root 下 使用
我通過 which rvm 找到 rvm的執行目錄
然后通過 chown -R 非root 用戶 /usr/bin/rvm
這樣一來 就可以在 非root 用戶下使用 rvm 和 homebrew 了

up vote196down vote

As The Tin Man suggests (above) RVM (Ruby Version Manager) is the Standard for upgrading your Ruby installation on OSX: https://rvm.io
To get started, open a Terminal Window and issue the following command:

\curl -L https://get.rvm.io | bash -s stable --ruby

( you will need to trust the RVM Dev Team that the command is not malicious - if you're a paranoid penguin like me, you can always go read the source: https://github.com/wayneeseguin/rvm ) When it's complete you need to restart the terminal to get the rvm
command working.

rvm list known

( shows you the latest available versions of Ruby )
rvm install ruby-2.3.1

For a specific version, followed by
rvm use ruby-2.3.1

or if you just want the latest (current) version:
rvm install current && rvm use current

( installs the current stable release - at time of writing ruby-2.3.1 - please update this wiki when new versions released )

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容

  • PLEASE READ THE FOLLOWING APPLE DEVELOPER PROGRAM LICENSE...
    念念不忘的閱讀 13,552評論 5 6
  • 今天糖果滿兩個月了。作為媽媽雖然很辛苦,但,所以付出和艱辛都是自愿的。因此,很坦然面對了現實。 兩個月的糖果,現在...
    安好生活家閱讀 241評論 0 0
  • 愛情的大門口 我排了好久好久 輪不到號碼 我進不到里頭 幸福的魔法毯 它離我好遠好遠 學不會法語 我飛不到上邊 茫...
    潮落晨曦閱讀 287評論 0 1