亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

不能用RVM-GCC問題在Lion下安裝Ruby

不能用RVM-GCC問題在Lion下安裝Ruby

慕絲7291255 2019-07-19 10:43:37
不能用RVM-GCC問題在Lion下安裝Ruby有關這個問題的大多數問題都是由于缺少Xcode造成的;我已經安裝了Xcode 4.2。安裝嘗試:rvm install 1.9.3Installing Ruby from source to: /Users/jamie/.rvm/rubies/ruby-1.9.3-p0, this may take a while depending on your cpu(s)...ruby-1.9.3-p0 - #fetching ruby-1.9.3-p0 - #extracted to /Users/jamie/.rvm/src/ruby-1.9.3-p0 (already extracted)Fetching yaml-0.1.4.tar.gz to /Users/jamie/.rvm/archivesExtracting yaml-0.1.4.tar.gz to /Users/jamie/.rvm/srcConfiguring yaml in /Users/jamie/.rvm/src/yaml-0.1.4.Compiling yaml in /Users/jamie/.rvm/src/yaml-0.1.4.Installing yaml to /Users/jamie/.rvm/usr ruby-1.9.3-p0 - #configuring ERROR: Error running ' ./configure --prefix=/Users/jamie/.rvm/rubies/ruby-1.9.3-p0 --enable-shared --disable-install-doc --with-libyaml-dir=/Users/jamie/.rvm/usr ', please read /Users/jamie/.rvm/log/ruby-1.9.3-p0/configure.log ERROR: There has been an error while running configure. Halting the installation.配置.log:[2011-11-07 04:32:17]  ./configure --prefix=/Users/jamie/.rvm/rubies/ruby-1.9.3-p0 --enable-shared --disable-install-doc --with-libyaml-dir=/Users/jamie/.rvm/usr  configure: WARNING: unrecognized options: --with-libyaml-dir checking build system type... x86_64-apple-darwin11.2.0checking host system type... x86_64-apple-darwin11.2.0checking target system type... x86_64-apple-darwin11.2.0checking whether the C compiler works... noconfigure: error: in `/Users/jamie/.rvm/src/ruby-1.9.3-p0': configure: error: C compiler cannot create executables See `config.log' for more details
查看完整描述

3 回答

?
智慧大石

TA貢獻1946條經驗 獲得超3個贊

這個答案經過多次編輯,現在包含了幾個替代解決辦法。先試試簡單的“編輯3”解決方案。

Ruby1.9.3-p 125及以后版本對clang的官方支持所以如果你安裝這樣一個版本,你不應該需要GCC。如果您正在安裝一個舊版本的Ruby,請繼續閱讀。

要用GCC編譯Ruby,需要一個沒有LLVM版本的GCC,它不再包含在XCode 4.2中。自己安裝(或暫時降級到XCode 4.1),然后執行CC=/usr/local/bin/gcc-4.2 rvm install 1.9.3 --enable-shared(替代通往非LLVM GCC的道路)。

編輯:https:/github.com/kenneresitz/OSX-GCC-Installer/下載可能有助于安裝GCC。還可以通過運行rvm requirements.

編輯2:為了更簡單的解決方案,您可以嘗試添加--with-gcc=clang的論點configure紅寶石用clang代替GCC。

編輯3rvm install 1.9.3 --with-gcc=clang為你這么做。

注意:對于當前版本的XCode,您需要在XCode菜單->Preferences->Download->Components中分別安裝命令行工具。這是在命令行上使用XCode進行任何編譯的先決條件,而不僅僅是Ruby。

注2:如果某些東西在執行這些步驟后不起作用,請嘗試重新啟動或重新登錄,以確保環境設置正確。

注3:1.9.3-p 125之前的Ruby版本可能并不總是與clang完全兼容,所以如果在生產環境中使用“編輯3”解決方案,請徹底測試軟件。


查看完整回答
反對 回復 2019-07-19
  • 3 回答
  • 0 關注
  • 785 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號