2012-11-22 89 views
-1

是否嘗試過使用RVM重新安裝紅寶石跑進此錯誤:山獅RVM力重裝錯誤

rvm reinstall all --force 
Removing /usr/local/rvm/src/ruby-1.9.3-p194... 
Removing /usr/local/rvm/rubies/ruby-1.9.3-p194... 
No binary rubies available for: osx/10.8/x86_64/ruby-1.9.3-p194. 
Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies. 
Installing Ruby from source to: /usr/local/rvm/rubies/ruby-1.9.3-p194, this may take a while depending on your cpu(s)... 
ruby-1.9.3-p194 - #downloading ruby-1.9.3-p194, this may take a while depending on your connection... 
ruby-1.9.3-p194 - #extracting ruby-1.9.3-p194 to /usr/local/rvm/src/ruby-1.9.3-p194 
ruby-1.9.3-p194 - #extracted to /usr/local/rvm/src/ruby-1.9.3-p194 
ruby-1.9.3-p194 - #configuring 
Error running 'env LDFLAGS=-L/opt/sm/pkg/active/lib CFLAGS=-I/opt/sm/pkg/active/include CPATH=/opt/sm/pkg/active/include -L/usr/local/rvm/usr/lib ./configure --enable-shared --disable-install-doc --prefix=/usr/local/rvm/rubies/ruby-1.9.3-p194', please read /usr/local/rvm/log/ruby-1.9.3-p194/configure.log 
There has been an error while running configure. Halting the installation. 

我能做些什麼來解決這個問題?提前致謝。

錯誤消息:

cat /usr/local/rvm/log/ruby-1.9.3-p194/configure.log 
[2012-11-22 09:39:59] env LDFLAGS=-L/opt/sm/pkg/active/lib CFLAGS=-I/opt/sm/pkg/active/include CPATH=/opt/sm/pkg/active/include -L/usr/local/rvm/usr/lib ./configure --enable-shared --disable-install-doc --prefix=/usr/local/rvm/rubies/ruby-1.9.3-p194 
checking build system type... x86_64-apple-darwin12.2.0 
checking host system type... x86_64-apple-darwin12.2.0 
checking target system type... x86_64-apple-darwin12.2.0 
checking whether the C compiler works... no 
configure: error: in `/usr/local/rvm/src/ruby-1.9.3-p194': 
configure: error: C compiler cannot create executables 
See `config.log' for more details 
unknown7cd1c3e98b07:~ pdenlinger$ cat config.log 
cat: config.log: No such file or directory 
unknown7cd1c3e98b07:~ pdenlinger$ 

GCC消息:

的gcc --version

i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00) 
Copyright (C) 2007 Free Software Foundation, Inc. 
This is free software; see the source for copying conditions. There is NO 
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 

'釀造醫生' 消息

brew doctor 
Warning: Unbrewed .pc files were found in /usr/local/lib/pkgconfig. 
If you didn't put them there on purpose they could cause problems when 
building Homebrew formulae, and may need to be deleted. 

Unexpected .pc files: 
    /usr/local/lib/pkgconfig/fuse.pc 
Warning: You have a non-Homebrew 'pkg-config' in your PATH: 
    /opt/sm/pkg/active/bin/pkg-config 

`./configure` may have problems finding brew-installed packages using 
this other pkg-config. 

外家釀配置腳本:

sudo mkdir /usr/local/Cellar 
Password: 
unknown7cd1c3e98b07:local pdenlinger$ sudo chown -R `whoami` /usr/local 
unknown7cd1c3e98b07:local pdenlinger$ man chown 
unknown7cd1c3e98b07:local pdenlinger$ brew doctor 
Warning: "config" scripts exist outside your system or Homebrew directories. 
`./configure` scripts often look for *-config scripts to determine if 
software packages are installed, and what additional flags to use when 
compiling and linking. 

Having additional scripts in your path can confuse software installed via 
Homebrew if the config script overrides a system or Homebrew provided 
script of the same name. We found the following "config" scripts: 

    /opt/sm/pkg/active/bin/curl-config 
    /opt/sm/pkg/active/bin/ncurses5-config 
    /opt/sm/pkg/active/bin/ncursesw5-config 
    /opt/sm/pkg/active/bin/pkg-config 
    /opt/sm/pkg/active/bin/xml2-config 
    /opt/sm/pkg/active/bin/xslt-config 
Warning: Unbrewed .pc files were found in /usr/local/lib/pkgconfig. 
If you didn't put them there on purpose they could cause problems when 
building Homebrew formulae, and may need to be deleted. 

Unexpected .pc files: 
    /usr/local/lib/pkgconfig/fuse.pc 
Warning: You have a non-Homebrew 'pkg-config' in your PATH: 
    /opt/sm/pkg/active/bin/pkg-config 

`./configure` may have problems finding brew-installed packages using 
this other pkg-config. 
+0

如果「讀/usr/local/rvm/log/ruby-1.9.3-p194/configure.log」作爲RVM問,這是否提供任何有用的信息? – Dmitri

+0

好的,下一條線索:「configure:error:C編譯器無法創建可執行文件」是gcc安裝在你的系統上---它是否與X代碼捆綁在一起?它工作嗎?或者你是否使用Xcode的替代方法,例如:http://stackoverflow.com/questions/11436674/how-can-i-install-ruby-1-9-3-in-mac-os-x-mountain- lion-without-xcode – Dmitri

+0

是的,已安裝GCC。消息添加到上面的正文。 – pdenlinger

回答

0

OK,因爲您的RVM與CFLAGS和路徑中運行:

CFLAGS=-I/opt/sm/pkg/active/include CPATH=/opt/sm/pkg/active/include 

您的gcc一定是來自家釀,不是Xcode中,這是no longer necessary

我的建議是重新安裝gcc,如上面的鏈接,並嘗試重新安裝紅寶石。

這個問題還可以幫助: RVM ruby installation errors - Mac

+0

嗯。我早些時候安裝了Homebrew和RVM,但是今天我剛接觸到Moncef Belyamani關於如何在Mountain Lion上安裝Ruby 1.9.3的說明,所以我正在嘗試再次這樣做。剛剛下載蘋果的命令行工具今天上午。我需要徹底卸載Homebrew和RVM,然後重新安裝嗎?那是什麼命令? – pdenlinger

+0

@pdenlinger我不知道你是否需要做一個乾淨的卸載,但我發現這一步通常比它引起的更令人頭疼 - 因爲它節省了查找各種配置文件和修改它們包含的路徑的麻煩。以下是卸載Homebrew的說明:http://superuser.com/questions/203707/how-to-uninstall-homebrew-osx-package-manager。 Rvm更容易卸載。二者必選其一 'RVM implode' 或 'RM -rf〜/ .rvm' – Dmitri

+0

剛剛卸載家釀和RVM,並做了一個新的安裝,當我跑'釀造醫生得到的消息。上面添加的消息。 – pdenlinger