安装Ruby-RVM-Mac OSX Mountain Lion [英] Installing Ruby - RVM - Mac OSX Mountain Lion

查看:124
本文介绍了安装Ruby-RVM-Mac OSX Mountain Lion的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我试图在运行Mountain Lion的Mac上安装Ruby 1.9.3.我已经安装了xCode,并且是最新的.我已经安装了RVM,现在正尝试使用rvm install 1.9.3安装Ruby.当我运行它时,它似乎将要安装,但是给我一个错误,请参见下面的内容:

So I'm trying to install Ruby 1.9.3 on my Mac running Mountain Lion. I have xCode installed and up to date. I've installed RVM and now am trying to install Ruby using rvm install 1.9.3 When I run this it looks like it's going to install but gives me an error please see below:

rvm install 1.9.3
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.8/x86_64/ruby-1.9.3-p392.
Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies.
Installing requirements for osx, might require sudo password.
Already up-to-date.
Certificates in '/Users/Colin/.rvm/etc/openssl/cert.pem' already are up to date.
Installing Ruby from source to: /Users/Colin/.rvm/rubies/ruby-1.9.3-p392, this may take a while depending on your cpu(s)...
ruby-1.9.3-p392 - #downloading ruby-1.9.3-p392, this may take a while depending on your connection...
ruby-1.9.3-p392 - #extracted to /Users/Colin/.rvm/src/ruby-1.9.3-p392 (already extracted)
ruby-1.9.3-p392 - #configuring........
Error running './configure --prefix=/Users/Colin/.rvm/rubies/ruby-1.9.3-p392 --with-opt-dir=/Users/Colin/.rvm/opt/libyaml:/Users/Colin/.rvm/opt/readline:/Users/Colin/.rvm/opt/libxml2:/Users/Colin/.rvm/opt/libxslt:/Users/Colin/.rvm/opt/libksba:/Users/Colin/.rvm/opt/openssl:/Users/Colin/.rvm/opt/sqlite --disable-install-doc --without-tcl --without-tk --enable-shared',
please read /Users/Colin/.rvm/log/ruby-1.9.3-p392/1366429269_configure.log
There has been an error while running configure. Halting the installation.

当我转到/1366429269_configure.log文件时,它说:

When I go to the /1366429269_configure.log file it says this:

[2013-04-19 20:41:09] ./configure
configure: WARNING: unrecognized options: --without-tcl, --without-tk
checking build system type... x86_64-apple-darwin12.2.1
checking host system type... x86_64-apple-darwin12.2.1
checking target system type... x86_64-apple-darwin12.2.1
checking whether the C compiler works... no
configure: error: in `/Users/Colin/.rvm/src/ruby-1.9.3-p392':
configure: error: C compiler cannot create executables
See `config.log' for more details

如果有人可以帮助我,将不胜感激!

If anyone could help me out it would be greatly appreciated!

我在这里尝试了此解决方案无法在以下位置安装Ruby带有RVM的Lion – GCC问题 rvm install 1.9.3 --with-gcc=clang,它发生了一些变化,这是新的输出:

I tried the solution here Can't install Ruby under Lion with RVM – GCC issues rvm install 1.9.3 --with-gcc=clang and it changed a bit, here is the new output:

rvm install 1.9.3 --with-gcc=clang
Installing requirements for osx, might require sudo password.
Already up-to-date.
Certificates in '/Users/Colin/.rvm/etc/openssl/cert.pem' already are up to date.
Warning: found user selected compiler 'clang', this will suppress RVM auto detection mechanisms.
Installing Ruby from source to: /Users/Colin/.rvm/rubies/ruby-1.9.3-p392, this may take a while depending on your cpu(s)...
ruby-1.9.3-p392 - #downloading ruby-1.9.3-p392, this may take a while depending on your connection...
ruby-1.9.3-p392 - #extracted to /Users/Colin/.rvm/src/ruby-1.9.3-p392 (already extracted)
ruby-1.9.3-p392 - #configuring.....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
ruby-1.9.3-p392 - #compiling..................................................................
Error running 'make -j8',
please read /Users/Colin/.rvm/log/ruby-1.9.3-p392/1366431470_make.log
There has been an error while running make. Halting the installation.

以下是日志: http://pastebin.com/P6nTZRQY

编辑

不知道发生了什么,但是我只是尝试了同样的事情,现在它运行良好.谢谢所有留下有用评论的人,我们将不胜感激!

Not sure what happened but I just tried the same thing and now it's working perfect. Thank you everyone who left a helpful comment, it's greatly appreciated!

推荐答案

您需要将命令行工具更新为最新版本,对于ruby 1.9.3,仍然首选使用gcc-4.2进行编译.

You need to update Command Line Tools to latest version, also for ruby 1.9.3 it is still preferred to use gcc-4.2 for compilation.

还请确保在重新尝试之前更新RVM:

Also make sure you update RVM before trying again:

rvm get head
rvm install 1.9.2

最后,Ruby 2.0.0应该与1.9.3兼容,并且您应该进行更新.

Finally, Ruby 2.0.0 should be compatible with 1.9.3 and you should update.

这篇关于安装Ruby-RVM-Mac OSX Mountain Lion的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆