2015-01-17 131 views
3

當我嘗試使用RVM安裝最新的Ruby版本時,我正遇到一些問題。我使用rvm install ruby-2.2.0獲取最新的Ruby版本

user$ rvm install ruby-2.2.0 
Searching for binary rubies, this might take some time. 
No binary rubies available for: osx/10.10/x86_64/ruby-2.2.0. 
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies. 
Checking requirements for osx. 
/usr/local/bin/brew: /usr/local/Library/brew.rb: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby: bad interpreter: No such file or directory 
/usr/local/bin/brew: line 21: /usr/local/Library/brew.rb: Undefined error: 0 
ERROR: '/bin' is not writable - it is required for Homebrew, try 'brew doctor' to fix it! 
Requirements installation failed with status: 1. 

我然後運行brew doctor並得到以下錯誤

/usr/local/bin/brew: /usr/local/Library/brew.rb: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby: bad interpreter: No such file or directory 
/usr/local/bin/brew: line 21: /usr/local/Library/brew.rb: Undefined error: 0 

RVM得到穩定的吩咐呈現給我這個警告,我還從來沒有得到穩定的版本時,收到以下錯誤

​​

我該如何解決這個問題?我一直在避開它,並且真的想讓它啓動並運行。提前

+0

見http://stackoverflow.com/a/24225960/429758 –

回答

8

感謝你需要做的:

cd /usr/local/Library 
git pull origin master 

這將升級你的自制軟件,你可以再次使用BREW。

如果您有權限的問題,請嘗試:

sudo git pull origin master 

對於約塞米蒂試試這個:

cd /System/Library/Frameworks/Ruby.framework/Versions 
sudo ln -s Current 1.8 
brew update 
sudo rm 1.8 

對於OS X 10.8.3試試這個:

sudo chown -R $USER:admin /usr/local 
cd /usr/local 
git reset --hard origin/master 
brew update 

的Mac OS X 10.10(Yosemite)不再附帶Ruby 1.8(僅限2.0) 使用git更新brew:

cd /usr/local/Library/ 
git branch --set-upstream-to=origin/master master 
# on branch master 
git pull 

對於第二個問題,編輯/Users/user/.bash_profile,再加入下句:

source ~/.profile