2011-12-05 148 views
1

我在使用rvm安裝ruby時遇到問題。我目前正在運行Mac OS X 10.6.8。 已經加載RVM,並重新啓動終端,我已經運行腳本:使用RVM安裝Ruby時出現的問題:rvm install 1.8.7,rvm install 1.9.2

$ rvm get latest 
(rvm update --head returned an error message: "ERROR: rvm update has been removed. See 'rvm get' and rvm 'rubygems' CLI API instead") 

$ rvm reload 
<RVM reloaded!> 

現在,我得到的問題:

$ rvm install 1.8.7 

得到的回報如下:

---------------------------------------------------------------------------------------- 
Installing Ruby from source to: /Users/user/.rvm/rubies/ruby-1.8.7-p352, this may take a while depending on your cpu(s)... 

ruby-1.8.7-p352 - #fetching 

ruby-1.8.7-p352 - #extracted to /Users/user/.rvm/src/ruby-1.8.7-p352 (already extracted) 
Applying patch 'stdout-rouge-fix' (located at /Users/user/.rvm/patches/ruby/1.8.7/stdout-rouge-fix.patch) 

ERROR: Error running 'patch -F 25 -p1 -N -f <"/Users/user/.rvm/patches/ruby/1.8.7/stdout-rouge-fix.patch"', please read /Users/user/.rvm/log/ruby-1.8.7-p352/patch.apply.stdout-rouge-fix.log 

ruby-1.8.7-p352 - #configuring 

ERROR: Error running 'MACOSX_DEPLOYMENT_TARGET=10.6 CFLAGS='-arch x86_64 -g -Os -pipe -no-cpp-precomp' CCFLAGS='-arch x86_64 -g -Os -pipe' CXXFLAGS='-arch x86_64 -g -Os -pipe' LDFLAGS='-arch x86_64 -bind_at_load' LDSHARED='cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace' ./configure --prefix=/Users/calebballoch/.rvm/rubies/ruby-1.8.7-p352 --enable-shared --disable-install-doc ', please read /Users/user/.rvm/log/ruby-1.8.7-p352/configure.log 

ERROR: There has been an error while running configure. Halting the installation. 

此外,當我安裝1.9.2版本時,我遇到了類似的問題。

$ rvm install 1.8.7 

將返回:

Installing Ruby from source to: /Users/user/.rvm/rubies/ruby-1.9.2-p290, this may take a while depending on your cpu(s)... 

ruby-1.9.2-p290 - #fetching 

ruby-1.9.2-p290 - #extracted to /Users/user/.rvm/src/ruby-1.9.2-p290 (already extracted) 

Fetching yaml-0.1.4.tar.gz to /Users/user/.rvm/archives 

Extracting yaml-0.1.4.tar.gz to /Users/user/.rvm/src 

Configuring yaml in /Users/user/.rvm/src/yaml-0.1.4. 

ERROR: Error running ' ./configure --prefix="/Users/user/.rvm/usr" ', please read /Users/user/.rvm/log/ruby-1.9.2-p290/yaml/configure.log 

Compiling yaml in /Users/user/.rvm/src/yaml-0.1.4. 

ERROR: Error running 'make ', please read /Users/user/.rvm/log/ruby-1.9.2-p290/yaml/make.log 
Installing yaml to /Users/user/.rvm/usr 

ERROR: Error running 'make install', please read /Users/user/.rvm/log/ruby-1.9.2-p290/yaml/make.install.log 

ruby-1.9.2-p290 - #configuring 

ERROR: Error running ' ./configure --prefix=/Users/user/.rvm/rubies/ruby-1.9.2-p290 --enable-shared --disable-install-doc --with-libyaml-dir=/Users/user/.rvm/usr ', please read /Users/user/.rvm/log/ruby-1.9.2-p290/configure.log 

ERROR: There has been an error while running configure. Halting the installation. 

回答

1

聲音對我來說,你沒有編譯器或使安裝的工具。首先安裝make和gcc?這些配備XCode的,如果你沒有的XCode安裝,安裝它,然後再試

做別的

cat /Users/user/.rvm/log/ruby-1.9.2-p290/yaml/make.install.log 

這裏粘貼此輸出。