2011-02-08 40 views
3

我试图在Mac OS X 10.6.6系统中更新Ruby。现在我有1.8.7,我想更新到1.9.2。 当我输入rvm install 1.9.2我:在Mac OS X上使用RVM更新我的Ruby版本时出错10.6.6

gal-harths-iMac:~ galharth$ rvm install 1.9.2 
/Users/galharth/.rvm/rubies/ruby-1.9.2-p136, this may take a while depending on your cpu(s)... 

ruby-1.9.2-p136 - #fetching 
ruby-1.9.2-p136 - #extracted to /Users/galharth/.rvm/src/ruby-1.9.2-p136 (already extracted) 
ruby-1.9.2-p136 - #configuring 
Error running ' ./configure --prefix=/Users/galharth/.rvm/rubies/ruby-1.9.2-p136 --enable-shared ', please read /Users/galharth/.rvm/log/ruby-1.9.2-p136/configure.log 
There has been an error while running configure. Halting the installation. 

我安装了Xcode和它仍然无法正常工作。

这是configure.log文件:

[2011-02-08 17:10:04] ./configure --prefix=/Users/galharth/.rvm/rubies/ruby-1.9.2-p136 --enable-shared 
checking build system type... i386-apple-darwin10.6.0 
checking host system type... i386-apple-darwin10.6.0 
checking target system type... i386-apple-darwin10.6.0 
checking for gcc... no 
checking for cc... no 
checking for cl.exe... no 
configure: error: in `/Users/galharth/.rvm/src/ruby-1.9.2-p136': 
configure: error: no acceptable C compiler found in $PATH 
See `config.log' for more details 
[2011-02-08 17:23:19] ./configure --prefix=/Users/galharth/.rvm/rubies/ruby-1.9.2-p136 --enable-shared 
checking build system type... i386-apple-darwin10.6.0 
checking host system type... i386-apple-darwin10.6.0 
checking target system type... i386-apple-darwin10.6.0 
checking for gcc... no 
checking for cc... no 
checking for cl.exe... no 
configure: error: in `/Users/galharth/.rvm/src/ruby-1.9.2-p136': 
configure: error: no acceptable C compiler found in $PATH 
See `config.log' for more details 
[2011-02-08 20:44:14] ./configure --prefix=/Users/galharth/.rvm/rubies/ruby-1.9.2-p136 --enable-shared 
checking build system type... i386-apple-darwin10.6.0 
checking host system type... i386-apple-darwin10.6.0 
checking target system type... i386-apple-darwin10.6.0 
checking for gcc... no 
checking for cc... no 
checking for cl.exe... no 
configure: error: in `/Users/galharth/.rvm/src/ruby-1.9.2-p136': 
configure: error: no acceptable C compiler found in $PATH 
See `config.log' for more details 
[2011-02-08 21:02:55] ./configure --prefix=/Users/galharth/.rvm/rubies/ruby-1.9.2-p136 --enable-shared 
checking build system type... i386-apple-darwin10.6.0 
checking host system type... i386-apple-darwin10.6.0 
checking target system type... i386-apple-darwin10.6.0 
checking for gcc... no 
checking for cc... no 
checking for cl.exe... no 
configure: error: in `/Users/galharth/.rvm/src/ruby-1.9.2-p136': 
configure: error: no acceptable C compiler found in $PATH 
See `config.log' for more details 
+0

你这样做的错误信息表明,读/用户/ galharth /。RVM /日志/红宝石1.9.2-P136/configure.log?它告诉了什么? – Mark 2011-02-08 19:01:07

回答

3

有你的日志文件输出一些怪事。你的问题显示你有Mac OS 10.6.6,但日志显示操作系统是i386。 Mac OS 10.6.6应该是x86_64。这意味着由于某种原因,当系统应该是64位时,系统会认为它是32位的。您的XCode版本需要是最新版本,所以如果您没有下载并安装它,那么请执行此操作。 Snow Leopard磁盘上的XCode版本有问题,而且在您的机器上安装10.6后,Snow Leopard之前的Mac OS版本已过时。

这里有一些事情要尝试。如果一个人工作,你完成了,否则尝试下一个。

  1. rvm -v并记下版本号,然后rvm get head其次rvm reload如果更新后显示的版本号已经改变。尝试运行rvm install 1.9.2-p136
  2. 使用rm ~/.rvm/src/ruby-1.9.2-p136删除~/.rvm/src/ruby-1.9.2-p136目录中的文件,然后尝试使用#1中的安装命令进行安装。
  3. 手动将Ruby 1.9.2-p136的副本手动下载到您的~/.rvm/archives目录中,并将其提取到您的~/.rvm/src/ruby-1.9.2-p136目录中。您可以cd ~/.rvm/archives,删除任何现有的旧版本的档案,然后使用curl -O ftp://ftp.ruby-lang.org:21//pub/ruby/1.9/ruby-1.9.2-p136.tar.gzwget ftp://ftp.ruby-lang.org:21//pub/ruby/1.9/ruby-1.9.2-p136.tar.gz拉一个新的版本。然后cd ~/.rvm/src然后从#2上面的rm命令,然后tar zxvf ../archives/ruby-1.9.2-p136.tar.gz提取文件,然后尝试运行#1中的RVM安装命令。

我有一台机器在代理之后,它不允许RVM进入Ruby存储库,导致存档实际上成为代理的失败通知。当RVM试图破解tar文件时,它会失败,但不能解决问题,然后尝试配置并失败。修复方法是手动下载存档并将其打包到src目录中。

0

发生这种情况时,我插入了Snow Leopard磁盘,选择了可选安装并安装了Xcode软件包。这解决了这里描述的C编译器问题。感谢这个博客:http://www.brianp.net/2009/09/05/snow-leopards-ate-my-c-compiler/

在我的情况下,一旦我解决了编译器问题,我得到了权限错误。在bash中以root身份运行给了rvm适当的权限。

2

使用命令rvm install 1.9.3 --with-gcc=clang为我工作。

相关问题