2012-03-22 174 views
4

如果我輸入有困難xcodebuild聯編-version它認識到,我已經安裝的Xcode:安裝RVM 1.9.3和Xcode 4.3.2

Xcode 4.3.2 
Build version 4E2002 

但是當我嘗試檢查RVM要求我得到如下:

Notes for Mac OS X 10.7.3, No Xcode. 
For JRuby: Install the JDK. See http://developer.apple.com/java/download/ # Current Java   version "1.6.0_26" 
For IronRuby: Install Mono >= 2.6 
For Ruby 1.9.3: Install libksba # If using Homebrew, 'brew install libksba' 

You can use & download osx-gcc-installer: https://github.com/kennethreitz/osx-gcc- installer 
** NOTE: Currently, Node.js is having issues building with osx-gcc-installer. The only fix  is to install Xcode over osx-gcc-installer. 

We had reports of http://hpc.sourceforge.net/ making things work, but it looks like not easiest/safest to setup. 

To use an RVM installed Ruby as default, instead of the system ruby: 

rvm install 1.8.7 # installs patch 357: closest supported version 
rvm system ; rvm gemset export system.gems ; rvm 1.8.7 ; rvm gemset import system.gems # migrate your gems 
rvm alias create default 1.8.7 

And reopen your terminal windows. 

Xcode 4.2: 
* is only supported by ruby 1.9.3+ using command line flag: --with-gcc=clang 
* it breaks gems with native extensions, especially DB drivers. 

它似乎是不承認我的Xcode和當我嘗試安裝RVM 1.9.3我得到:

Fetching yaml-0.1.4.tar.gz to /Users/sikandarshukla/.rvm/archives 
Extracting yaml-0.1.4.tar.gz to /Users/sikandarshukla/.rvm/src 
Configuring yaml in /Users/sikandarshukla/.rvm/src/yaml-0.1.4. 
Error running ' ./configure --prefix="/Users/sikandarshukla/.rvm/usr" ', please read    /Users/sikandarshukla/.rvm/log/ruby-1.9.3-p125/yaml/configure.log 
Compiling yaml in /Users/sikandarshukla/.rvm/src/yaml-0.1.4. 
Error running 'make ', please read /Users/sikandarshukla/.rvm/log/ruby-1.9.3- p125/yaml/make.log 


Database file /Users/sikandarshukla/.rvm/config/packages does not exist. 

/Users/sikandarshukla/.rvm/scripts/functions/build: line 28: --version: command not found 
Installing Ruby from source to: /Users/sikandarshukla/.rvm/rubies/ruby-1.9.3-p125, this  may take a while depending on your cpu(s)... 

ruby-1.9.3-p125 - #fetching 
ruby-1.9.3-p125 - #extracted to /Users/sikandarshukla/.rvm/src/ruby-1.9.3-p125 (already extracted) 
ruby-1.9.3-p125 - #configuring 
Error running ' ./configure --prefix=/Users/sikandarshukla/.rvm/rubies/ruby-1.9.3-p125 -- enable-shared --disable-install-doc --with-libyaml --with-opt- dir=/Users/sikandarshukla/.rvm/usr ', please read /Users/sikandarshukla/.rvm/log/ruby-1.9.3- p125/configure.log 
There has been an error while running configure. Halting the installation. 

現在,如果我讀的日誌,貓/Users/sikandarshukla/.rvm/log/ruby-1.9.3-p125/configure.log的輸出如下:

./configure --prefix=/Users/sikandarshukla/.rvm/rubies/ruby-1.9.3-p125 --enable-shared --  disable-install-doc --with-libyaml --with-opt-dir=/Users/sikandarshukla/.rvm/usr 
configure: WARNING: unrecognized options: --with-libyaml 
checking build system type... i386-apple-darwin11.3.0 
checking host system type... i386-apple-darwin11.3.0 
checking target system type... i386-apple-darwin11.3.0 
checking whether the C compiler works... no 
configure: error: in `/Users/sikandarshukla/.rvm/src/ruby-1.9.3-p125': 
configure: error: C compiler cannot create executables 
See `config.log' for more details 

貓/Users/sikandarshukla/.rvm/log/ruby-1.9.3-p125/yaml/configure.log的輸出如下:

./configure --prefix="/Users/sikandarshukla/.rvm/usr" 
checking for a BSD-compatible install... /usr/bin/install -c 
checking whether build environment is sane... yes 
checking for a thread-safe mkdir -p... config/install-sh -c -d 
checking for gawk... no 
checking for mawk... no 
checking for nawk... no 
checking for awk... awk 
checking whether make sets $(MAKE)... no 
checking for gcc... no 
checking for cc... no 
checking for cl.exe... no 
configure: error: in `/Users/sikandarshukla/.rvm/src/yaml-0.1.4': 
configure: error: no acceptable C compiler found in $PATH 
See `config.log' for more details 

任何想法做什麼,謝謝爲你的h ELP

+0

OK,所以我跟着一些技巧上此鏈接:http://stackoverflow.com/questions/8032824/cant-install-ruby-under-lion-with-rvm-gcc-issues#_=_ – bhaity 2012-03-22 07:11:01

回答

2

它在識別的Xcode版中的錯誤,我已經建立了一張票,它應該會很快解決 - >https://github.com/wayneeseguin/rvm/issues/846

所有的Xcode 4.2+有同樣的問題:

4.2:

  • 僅支持ruby 1.9.3+使用命令行標誌:--with-gcc = clang
  • 它破壞了本機擴展的寶石,特別是數據庫驅動程序。

爲了解決使用OSX,GCC的安裝程序:

您可以使用&下載OSX,GCC的安裝程序:https://github.com/kennethreitz/osx-gcc-installer

+1

看起來像你在第二天解決這個問題。謝謝! – Purplejacket 2012-03-27 21:29:53