2014-01-14 161 views
1

我想安裝Ruby 1.9.2,以便我可以在Ruby中進行在線課程。我剛剛通過OSX升級到Mavericks(10.9.1),以便我可以安裝最新版本的XCode(5.0.2),現在也安裝了它。無法在更新的OS X小牛上安裝Ruby

我確定我必須在這裏丟失一些基本的東西。任何人都可以看看我的終端安裝日誌和錯誤消息在這裏幫助我嗎?我很欣賞任何想法。

dave-morans-macbook:~ davemoran$ rvm install 1.9.2 
Searching for binary rubies, this might take some time. 
No binary rubies available for: osx/10.9/x86_64/ruby-1.9.2-p320. 
It is not possible to build movable binaries for rubies 1.8-1.9.2, but you can do it for your system only. 
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies. 
Checking requirements for osx. 
Installing macports... 
Error running 'requirements_osx_port_install_port', 
showing last 15 lines of /Users/davemoran/.rvm/log/1389714845_ruby-1.9.2-p320/port_install.log 
checking build system type... i386-apple-darwin13.0.0 
checking host system type... i386-apple-darwin13.0.0 
checking target system type... i386-apple-darwin13.0.0 
checking MacPorts version... 2.2.1 
checking for sw_vers... /usr/bin/sw_vers 
checking for defaults... /usr/bin/defaults 
checking for xcode-select... /usr/bin/xcode-select 
checking Mac OS X version... 10.9.1 
checking Xcode location... /Applications/Xcode.app/Contents/Developer 
checking Xcode version... 5.0.2 
checking for gcc... gcc 
checking whether the C compiler works... no 
configure: error: in `/Users/davemoran/.rvm/src/MacPorts-2.2.1': 
configure: error: C compiler cannot create executables 
See `config.log' for more details 
Requirements installation failed with status: 77. 

回答

3

您將需要安裝Xcode的命令行工具。

您還可以嘗試在上面的rvm命令末尾添加--with-gcc=gcc-4.2

+0

我試着像這樣的命令輸出:「RVM安裝1.9.2 --with-GCC = GCC-4.2」 ,並得到這樣的:「你要求的建築'gcc-4.2',但它不在你的路上。「我再次猜測我可能錯誤地輸入了命令 – user3194689

1

您可能缺少Xcode的命令行工具。您可以從Xcode-> Preferences-> Downloads或從命令行xcode-select --install安裝它們。

安裝命令行工具後嘗試rvm install。

+1

謝謝。當我查看Xcode本身的下載首選項窗格時,沒有可用的命令行工具下載,所以我嘗試按照您的建議,xammy進行操作,然後從終端的命令行中直接進入。一切正常啓動後,我同意Xcode中的條款,然後在命令行開發工具安裝程序中得到此錯誤消息:「無法安裝軟件,因爲它目前不能從軟件更新服務器上獲得。」 – user3194689

+0

Xcode 5.2和命令行工具似乎存在一些問題。所以雖然他們可能已經安裝了所需的組件,但它們仍然會顯示該錯誤。你可以分享「gcc --version」的輸出嗎? – Sam

+0

我也看到了這個 Apple LLVM 5.0版(clang-500.2.79)(基於LLVM 3.3svn) – rbp

0

我有,當我試圖在OSX小牛安裝較舊的紅寶石(2.0.0p247)同樣的錯誤,這是對我工作:

$ rvm install 2.0.0-p247 --with-readline-dir=$rvm_path/usr --with-openssl-dir=$rvm_path/usr --disable-binary --with-gcc=gcc-4.2 

HTH,
弗羅林。

4

這是最後用的Xcode 5.1.1(5B1008)

rvm install 1.9.3 --with-gcc=/Applications/Xcode.app/Contents/Developer/usr/bin/gcc 

編輯爲我工作在OSX 10.9.3:上面的命令也可以輔以其他選項。我把這些選項從現有的安裝失敗

rvm install 1.9.3 --with-gcc=/Applications/Xcode.app/Contents/Developer/usr/bin/gcc --with-opt-dir=/usr/local/Cellar/libyaml/0.1.6:/usr/local/Cellar/readline/6.3.6:/usr/local/Cellar/libksba/1.3.0:/usr/local/opt/openssl --without-tcl --without-tk --disable-install-doc --enable-shared