由于 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 )