我以前見過很多帖子,並且按照他們的說明操作,但沒有任何工作。我將在下面概述我所做的事情,以及我所遵循的指示 - 對任何建議都將感激不盡!在山獅上安裝Ruby的問題 - 紅寶石1.9.3不會'編譯
我一直遵守以下安裝說明: http://pragmaticstudio.com/blog/2010/9/23/install-rails-ruby-mac
我已經下載X-代碼OSX山獅,並安裝了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.
我已經那麼做了的指示和安裝git的最新版本
$ git --version
git version 1.7.10.2 (Apple Git-33)
並且通過命令行對rvm進行類似的操作:
$ rvm --version
rvm 1.16.13 (stable) by Wayne E. Seguin <[email protected]>, Michal Papis <[email protected]> [https://rvm.io/]
當我再嘗試使用RVM紅寶石安裝,我得到如下:
$ rvm install 1.9.3
No binary rubies available for: osx/10.8/x86_64/ruby-1.9.3-p286.
Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies.
Installing Ruby from source to: /Users/mondemoo/.rvm/rubies/ruby-1.9.3-p286, this may take a while depending on your cpu(s)...
ruby-1.9.3-p286 - #downloading ruby-1.9.3-p286, this may take a while depending on your connection...
ruby-1.9.3-p286 - #extracted to /Users/mondemoo/.rvm/src/ruby-1.9.3-p286 (already extracted)
ruby-1.9.3-p286 - #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/Users/mondemoo/.rvm/usr/lib ./configure --enable-shared --disable-install-doc --prefix=/Users/mondemoo/.rvm/rubies/ruby-1.9.3-p286', please read /Users/mondemoo/.rvm/log/ruby-1.9.3-p286/configure.log
There has been an error while running configure. Halting the installation.
使用備用命令行,我收到了類似的輸出雖然有一些額外的比特:
$ rvm install 1.9.3 --with-gcc=clang
-bash: -dumpversion: command not found
-bash: --version: command not found
-bash: --version: command not found
Installing Ruby from source to: /Users/mondemoo/.rvm/rubies/ruby-1.9.3-p286, this may take a while depending on your cpu(s)...
ruby-1.9.3-p286 - #downloading ruby-1.9.3-p286, this may take a while depending on your connection...
ruby-1.9.3-p286 - #extracted to /Users/mondemoo/.rvm/src/ruby-1.9.3-p286 (already extracted)
ruby-1.9.3-p286 - #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/Users/mondemoo/.rvm/usr/lib ./configure --enable-shared --disable-install-doc --prefix=/Users/mondemoo/.rvm/rubies/ruby-1.9.3-p286 --with-gcc=clang', please read /Users/mondemoo/.rvm/log/ruby-1.9.3-p286/configure.log
There has been an error while running configure. Halting the installation.
-bash: --version: command not found
尋找到configure.logs,我得到以下內容:
$ less /Users/mondemoo/.rvm/log/ruby-1.9.3-p286/configure.log
[2012-10-17 07:39:15] env LDFLAGS=-L/opt/sm/pkg/active/lib CFLAGS=-I/opt/sm/pkg/active/include CPATH=/opt/sm/pkg/active/include -L/Users/mondemoo/.rvm/usr/lib ./configure --enable-shared --disable-install-doc --prefix=/Users/mondemoo/.rvm/rubies/ruby-1.9.3-p286 --with-gcc=clang
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 `/Users/mondemoo/.rvm/src/ruby-1.9.3-p286':
configure: error: C compiler cannot create executables
See `config.log' for more details
我現在完全困惑,我做錯了什麼 - 是否有人能夠協助?看來c編譯器(gcc?)存在問題,我是否正確解釋它?如果是的話我該如何解決這個問題?另外我如何獲得上面configure.log中提到的這個「config.log」?
謝謝!
請使用四空格縮進來格式化您的文章以獲取終端輸出。 –
那麼配置日誌說什麼? – halfelf
請閱讀/Users/mondemoo/.rvm/log/ruby-1.9.3-p286/configure.log,它很禮貌。 –