Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/22.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
Ruby 如何在运行10.6的Macbook Pro i7上修复此RVM错误_Ruby_Rvm - Fatal编程技术网

Ruby 如何在运行10.6的Macbook Pro i7上修复此RVM错误

Ruby 如何在运行10.6的Macbook Pro i7上修复此RVM错误,ruby,rvm,Ruby,Rvm,我收到了本页上描述的错误,在遵循他们的指示时,我收到了以下错误: [2011-02-13 11:05:03] ./configure --prefix=/Users/MYNAME/.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 checki

我收到了本页上描述的错误,在遵循他们的指示时,我收到了以下错误:

[2011-02-13 11:05:03]  ./configure --prefix=/Users/MYNAME/.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... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... configure: error: in `/Users/MYNAME/.rvm/src/ruby-1.9.2-p136':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
我想这个:看起来像一个aswer,但我找不到.rvmrc

编辑:我想问题出在i386上。我的1.8.2安装版本似乎是x8x_64

编辑2:经过一点更多的工作,我有它吐出这个错误

[2011-02-13 11:51:05]  ./configure --prefix=/Users/MYNAME/.rvm/rubies/ruby-1.9.2-p136 --enable-shared            --build=i386-apple-darwin10.6.0           --host=i386-apple-darwin10.6.0 
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 i386-apple-darwin10.6.0-gcc... no
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for i386-apple-darwin10.6.0-g++... no
checking for i386-apple-darwin10.6.0-c++... no
checking for i386-apple-darwin10.6.0-gpp... no
checking for i386-apple-darwin10.6.0-aCC... no
checking for i386-apple-darwin10.6.0-CC... no
checking for i386-apple-darwin10.6.0-cxx... no
checking for i386-apple-darwin10.6.0-cc++... no
checking for i386-apple-darwin10.6.0-cl.exe... no
checking for i386-apple-darwin10.6.0-FCC... no
checking for i386-apple-darwin10.6.0-KCC... no
checking for i386-apple-darwin10.6.0-RCC... no
checking for i386-apple-darwin10.6.0-xlC_r... no
checking for i386-apple-darwin10.6.0-xlC... no
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C preprocessor... /lib/cpp
configure: error: in `/Users/MYNAME/.rvm/src/ruby-1.9.2-p136':
configure: error: C preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details
[2011-02-13 11:58:36]  ./configure --prefix=/Users/MYNAME/.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... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... configure: error: in `/Users/MYNAME/.rvm/src/ruby-1.9.2-p136':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details

我会放进你的OSXCD,然后再次安装xcode

我会放进你的os x光盘,然后再次安装xcode

@eggie5说:


我会放进你的OSXCD,然后再次安装xcode

请勿从DVD安装XCode。10.6SnowLeopard磁盘上的版本被认为是有缺陷的。从站点安装最新版本。你必须注册才能下载,但这是免费注册

我怀疑您升级到了10.6,而不是在购买机器时默认安装的。10.6和它的相关XCode版本一样是64位的,所以一切都应该是64位的。因为它不是普通的Leopard或10.6之前的操作系统。这意味着所有RVM托管的红宝石都是可疑的,需要清理,以及在升级和更新XCode之前编译的任何GEM

安装XCode发行版后,需要卸载,然后安装RVM托管的Rubies。首先,将RVM更新至最新版本:RVM-v型,并记下版本号。键入rvm get head以加载最新版本。当它完成加载后,您应该会看到一个新的修订号。RVM变化很快,因此您希望定期更新到最新版本

这是来自的,这是使用RVM的非常好的信息,特别是关于使用sudo和gems的评论:

我的ruby编译为32位,但我在MacOSXSnowLeopard上,它有大量的广告说它是64位

RVM编译到当前运行的内核的体系结构。这意味着,如果内核作为32位内核uname-m运行,它将编译32位。在安装ruby解释器之前,可以通过在~/.rvmrc中放置以下内容来覆盖此行为:

rvm_archflags=-arch x86_64

我认为设置它是一个好主意,而不是依赖默认值,因为从现在起您可能将使用64位

键入rvm reload或关闭终端窗口并重新打开会话

键入rvm注释并阅读。这将根据您的操作系统为您提供顺利安装Ruby所需的先决条件列表。未能安装这些功能意味着各种功能可能无法在Ruby中工作,这将导致随机的、奇怪的故障

键入rvm列表并记下已安装的Ruby版本。假设你的第一个是ruby-1.8.7-p330。类型:

对已安装的每个组件重复此操作。完成后,键入rvm info并查看其所述内容是否通过了健全性检查

如果一切看起来都很好,那么是时候为您的gems重建本机驱动程序了

这两个步骤都是可选的,但都是良好的定期内务管理的一部分:

如果您已经有一段时间没有运行gem更新,您可能需要给gem一个更新。rvm ruby“gem update”将遍历已安装的ruby,并对其进行更新。 人们积累旧宝石,但往往不清理它们,所以,为了加快重建你的宝石,你可能应该清理你的旧宝石。您必须注意它在处理过程中告诉您的内容,因为它会让您知道无法满足的依赖关系。rvm ruby“gem clean”将遍历已安装的红宝石,并清理旧东西。 要重建本机驱动程序,请键入rvm-ruby'gem pristine-all',它将重新安装所有gems

之后,运行rvm info并确保它再次返回正常信息

另外,作为一个紧急逃生舱,通过键入rm-f~/.rvm或使用rvm内爆,然后重新开始,完全可以安全地吹走~/.rvm目录。重新安装Ruby是整个过程中最长的一部分,而一旦有了支持库,RVM就会让它变得非常轻松。

@eggie5说:


我会放进你的OSXCD,然后再次安装xcode

请勿从DVD安装XCode。10.6SnowLeopard磁盘上的版本被认为是有缺陷的。从站点安装最新版本。你必须注册才能下载,但这是免费注册

我怀疑您升级到了10.6,而不是在购买机器时默认安装的。10.6和它的相关XCode版本一样是64位的,所以一切都应该是64位的。因为它不是普通的Leopard或10.6之前的操作系统。这意味着所有RVM托管的红宝石都是可疑的,需要清理,以及在升级和更新XCode之前编译的任何GEM

安装XCode发行版后,需要卸载,然后安装RVM托管的Rubies。首先,将RVM更新至最新版本: 键入rvm-v并记下修订号。键入rvm get head以加载最新版本。当它完成加载后,您应该会看到一个新的修订号。RVM变化很快,因此您希望定期更新到最新版本

这是来自的,这是使用RVM的非常好的信息,特别是关于使用sudo和gems的评论:

我的ruby编译为32位,但我在MacOSXSnowLeopard上,它有大量的广告说它是64位

RVM编译到当前运行的内核的体系结构。这意味着,如果内核作为32位内核uname-m运行,它将编译32位。在安装ruby解释器之前,可以通过在~/.rvmrc中放置以下内容来覆盖此行为:

rvm_archflags=-arch x86_64

我认为设置它是一个好主意,而不是依赖默认值,因为从现在起您可能将使用64位

键入rvm reload或关闭终端窗口并重新打开会话

键入rvm注释并阅读。这将根据您的操作系统为您提供顺利安装Ruby所需的先决条件列表。未能安装这些功能意味着各种功能可能无法在Ruby中工作,这将导致随机的、奇怪的故障

键入rvm列表并记下已安装的Ruby版本。假设你的第一个是ruby-1.8.7-p330。类型:

对已安装的每个组件重复此操作。完成后,键入rvm info并查看其所述内容是否通过了健全性检查

如果一切看起来都很好,那么是时候为您的gems重建本机驱动程序了

这两个步骤都是可选的,但都是良好的定期内务管理的一部分:

如果您已经有一段时间没有运行gem更新,您可能需要给gem一个更新。rvm ruby“gem update”将遍历已安装的ruby,并对其进行更新。 人们积累旧宝石,但往往不清理它们,所以,为了加快重建你的宝石,你可能应该清理你的旧宝石。您必须注意它在处理过程中告诉您的内容,因为它会让您知道无法满足的依赖关系。rvm ruby“gem clean”将遍历已安装的红宝石,并清理旧东西。 要重建本机驱动程序,请键入rvm-ruby'gem pristine-all',它将重新安装所有gems

之后,运行rvm info并确保它再次返回正常信息


另外,作为一个紧急逃生舱,通过键入rm-f~/.rvm或使用rvm内爆,然后重新开始,完全可以安全地吹走~/.rvm目录。重新安装Ruby是整个过程中最长的一部分,一旦有了支持库,RVM就会让它变得非常轻松。

它对x86_64和i386说不……它对x86_64和i386说不……10.6 DVD上的XCode已知有缺陷。它需要使用苹果XCode站点的版本进行安装/更新。10.6 DVD上的XCode已知有缺陷。它需要使用苹果XCode站点的版本进行安装/更新。嗯,这是彻底的。我已经在下载xcode了,因为我把eggie的建议理解为重新安装xcode。非常感谢。如果这有效,我一定会接受!嘿,好吧,我在Mac电脑和几个Linux发行版上使用RVM有一段时间了,好几次把自己搞砸了下载和重新安装XCode肯定是整个过程中最长的部分。慢慢来,阅读所有提示,您应该会很好,因为您已经有了一个正常的安装。此外,RVM的作者对问题的反应非常积极;你可以从rvm-v获得他的电子邮件地址。似乎有些事情超出了我的控制,但现在我得到了“运行时出错。/configure-prefix=/Users/MYNAME/.rvm/rubies/ruby-1.9.2-p136-enable shared-build=x86_64-apple-darwin10.6.0-host=x86_64-apple-darwin10.6.0”,请阅读/Users/MYNAME/.rvm/log/ruby-1.9.2-p136/configure.log'当我尝试安装任何版本的ruby时,请阅读/Users/MYNAME/.rvm/log/ruby-1.9.2-p136/configure.log告诉您什么?好吧,这是彻底的。我已经在下载xcode了,因为我把eggie的建议理解为重新安装xcode。非常感谢。如果这有效,我一定会接受!嘿,好吧,我在Mac电脑和几个Linux发行版上使用RVM有一段时间了,好几次把自己搞砸了下载和重新安装XCode肯定是整个过程中最长的部分。慢慢来,阅读所有提示,您应该会很好,因为您已经有了一个正常的安装。此外,RVM的作者对问题的反应非常积极;你可以从rvm-v获得他的电子邮件地址。似乎有些事情超出了我的控制,但现在我得到了“运行时出错。/configure-prefix=/Users/MYNAME/.rvm/rubies/ruby-1.9.2-p136-enable shared-build=x86_64-apple-darwin10.6.0-host=x86_64-apple-darwin10.6.0”,当我尝试安装任何版本的rubyAnd时,请阅读/Users/MYNAME/.rvm/log/ruby-1.9.2-p136/configure.log 请阅读/Users/MYNAME/.rvm/log/ruby-1.9.2-p136/configure.log告诉您什么?
rvm uninstall ruby-1.8.7-p330
rvm install ruby-1.8.7-p330