2011-10-13 164 views
4

我想在OSX Lion(10.7.2)的全新MacBook Air上安装Ruby 1.9.2,并在安装过程中不断收到错误消息。我是Ruby新手,从Ruby on Rails 3 Tutorial开始,所以我下载了RVM,然后运行命令“$ rvm install 1.9.2”。这就是发生了什么:为什么我无法在Mac OSX Lion上安装Ruby 1.9.2?

Installing Ruby from source to: /Users/richardberger/.rvm/rubies/ruby-1.9.2-p290 
ruby-1.9.2-p290 - #fetching 
ruby-1.9.2-p290 - #extracted to /Users/richardberger/.rvm/src/ruby-1.9.2-p290 
Fetching yaml-0.1.4.tar.gz to /Users/richardberger/.rvm/archives 
Extracting yaml-0.1.4.tar.gz to /Users/richardberger/.rvm/src 
Configuring yaml in /Users/richardberger/.rvm/src/yaml-0.1.4. 
ERROR: Error running ' ./configure --prefix="/Users/richardberger/.rvm/usr" ', 
please read /Users/richardberger/.rvm/log/ruby-1.9.2-p290/yaml/configure.log 
Compiling yaml in /Users/richardberger/.rvm/src/yaml-0.1.4. 
ERROR: Error running 'make ', please read 
/Users/richardberger/.rvm/log/ruby-1.9.2-p290/yaml/make.log 
Installing yaml to /Users/richardberger/.rvm/usr 
ERROR: Error running 'make install', please read 
/Users/richardberger/.rvm/log/ruby-1.9.2-p290/yaml/make.install.log 
ruby-1.9.2-p290 - #configuring 
ERROR: Error running ' ./configure 
--prefix=/Users/richardberger/.rvm/rubies/ruby-1.9.2-p290 --enable-shared 
--disable-install-doc --with-libyaml-dir=/Users/richardberger/.rvm/usr ', 
please read /Users/richardberger/.rvm/log/ruby-1.9.2-p290/configure.log 
ERROR: There has been an error while running configure. Halting the installation. 

任何帮助或替代解决方案将不胜感激。由于我是新手,请告诉我是否需要提供更多信息。

谢谢!

更新:这里是从配置日志信息:

[2011-10-13 11:26:35] ./configure 
--prefix=/Users/richardberger/.rvm/rubies/ruby-1.9.2-p290 
--enable-shared --disable-install-doc 
--with-libyaml-dir=/Users/richardberger/.rvm/usr 
configure: WARNING: unrecognized options: --with-libyaml-dir 
checking build system type... i386-apple-darwin11.2.0 
checking host system type... i386-apple-darwin11.2.0 
checking target system type... i386-apple-darwin11.2.0 
checking for gcc... no 
checking for cc... no 
checking for cl.exe... no 
configure: error: in 
`/Users/richardberger/.rvm/src/ruby-1.9.2-p290': 
configure: error: no acceptable C compiler found in $PATH 
See `config.log' for more details 

这是否意味着我需要下载一个C编译器(如了XCode?)

UPDATE(2):问题通过下载来解决Xcode中!

+0

在第二行中,它表示检出日志。你有吗?你可以发布吗? –

+2

文件'/ Users/richardberger/.rvm/log/ruby​​-1.9.2-p290/configure.log'内容是什么? –

+2

您是否先安装XCode?您可以从应用商店获取它,但它会安装一个安装程序。然后,您必须运行它放入应用程序文件夹中的安装程序。如错误输出中提到的 – Jason

回答

3

错误:在$ PATH发现

也没有可接受的C编译器,你没有安装Mac上的Xtools可以开发套件!例如没有C编译器...

你应该弹出在OS X DVD或闪存驱动器里面传来与您的计算机,并安装了Xtools, ,之后尝试重新安装Ruby ..

+1

非常感谢Tilo(以及所有评论过的人)。下载Xcode的工作,我现在正在设置所有的东西。 – RBergs

+0

RBergs,请[接受这个答案,如果它帮助你解决你的问题](http://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work/5235#5235)。这将清楚地表明,这个问题已得到满意的回答,为未来的访问者提供了一个指出哪些答案有效(如果有的话),并给予答案一些额外的声誉,作为继续回答问题的动机。谢谢! – sarnold

相关问题