Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Mac OS X 10.6.6上使用RVM更新我的Ruby版本时出错_Ruby_Macos_Rvm - Fatal编程技术网

在Mac OS X 10.6.6上使用RVM更新我的Ruby版本时出错

在Mac OS X 10.6.6上使用RVM更新我的Ruby版本时出错,ruby,macos,rvm,Ruby,Macos,Rvm,我尝试在MacOSX10.6.6系统中更新Ruby。现在我有了1.8.7,我想更新到1.9.2。 当我键入rvm安装1.9.2时,我得到: 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.

我尝试在MacOSX10.6.6系统中更新Ruby。现在我有了1.8.7,我想更新到1.9.2。 当我键入
rvm安装1.9.2
时,我得到:

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

日志文件输出中有一些奇怪之处。您的问题显示您有Mac OS 10.6.6,但日志显示该操作系统是i386。Mac OS 10.6.6应该是x86_64。这意味着出于某种原因,您的系统认为它是32位的,而实际上它应该是64位的。您的版本需要是最新的,所以如果您不只是下载并安装它,那么就这样做。Snow Leopard磁盘上的版本有缺陷,并且在机器上安装10.6后,Snow Leopard之前的Mac OS版本已过时

这里有一些东西可以尝试。如果其中一个有效,你就完成了,否则试试下一个

  • 执行
    rvm-v
    并记录版本号,然后
    rvm get head
    如果更新后显示的版本号已更改,则执行
    rvm reload
    。尝试运行
    rvm安装1.9.2-p136
  • 使用
    rm~/.rvm/src/ruby-1.9.2-p136
    删除
    ~/.rvm/src/ruby-1.9.2-p136
    目录中的文件,然后使用#1中的install命令尝试安装
  • 手动将的副本下载到
    ~/.rvm/archives
    目录中,并将其解压缩到
    ~/.rvm/src/ruby-1.9.2-p136
    目录中。您可以
    cd~/.rvm/archives
    ,删除存档的任何现有旧版本,然后使用
    curl-O
    wget
    导入新版本。然后是
    cd~/.rvm/src
    然后是上面#2中的
    rm
    命令,然后是
    tar zxvf../archives/ruby-1.9.2-p136.tar.gz
    以提取文件,然后尝试在#1中运行rvm install命令
    我有一台在代理后面的机器,它不允许RVM访问Ruby存储库,导致存档实际上是代理的失败通知。当RVM尝试爆破tar文件时,它将失败,但无法捕获问题,然后尝试配置并失败。修复方法是手动下载归档文件并将其放入
    src
    目录。

    当我遇到这种情况时,我插入了雪豹磁盘,选择了可选安装并安装了Xcode软件包。这解决了这里描述的缺少C编译器的问题。感谢这个博客:


    在我的例子中,一旦我解决了编译器问题,我就得到了一个权限错误。在bash中以root用户身份运行为rvm提供了适当的权限。

    使用命令
    rvm install 1.9.3——gcc=clang
    对我很有效。

    如果您正在运行Lion,请检查以确保已安装命令行工具。他们将它们从XCode中分离出来,所以现在它们是单独的下载。你可以在这里找到它们:


    您是否按照错误消息的指示执行了操作并读取了/Users/galharth/.rvm/log/ruby-1.9.2-p136/configure.log?它告诉了我什么?对于我编辑的问题,我添加了一个configure.log文件。你能从命令行中包括
    echo$PATH
    哪个gcc
    的输出吗?Xcode只是一个IDE;你需要一个C编译器。gcc附带Mac OS X开发工具,因此请尝试下载该.XCode是开发环境的名称,其中包括编译器、make、所有头文件等。下载和安装XCode将安装所有开发工具。