2

所以我试图在运行 Mountain Lion 的 Mac 上安装 Ruby 1.9.3。我已经安装了 xCode 并且是最新的。我已经安装了 RVM,现在正在尝试安装 Ruby,rvm install 1.9.3当我运行它时,它看起来像是要安装但给了我一个错误,请参见下文:

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 文件时,它说:

[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

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

编辑:

我在这里尝试了解决方案Can't install Ruby under Lion with RVM – GCC issues rvm install 1.9.3 --with-gcc=clang,它发生了一些变化,这是新的输出:

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

编辑

不知道发生了什么,但我只是尝试了同样的事情,现在它工作得很好。感谢所有留下有用评论的人,非常感谢!

4

3 回答 3

2

您需要将命令行工具更新到最新版本,对于 ruby​​ 1.9.3,它仍然首选gcc-4.2用于编译。

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

rvm get head
rvm install 1.9.2

最后,Ruby2.0.0应该兼容1.9.3并且应该更新。

于 2013-04-20T17:28:00.620 回答
1

尝试使用它,它将安装所有

   wget --no-check-certificate https://raw.github.com/joshfng/railsready/master/railsready.sh && bash railsready.sh
于 2013-04-20T10:17:24.353 回答
1

一个月前,我在尝试在 Lion 上安装 Ruby on Rails 时遇到了类似的问题。最后,我使用了安装程序。如果使用安装程序对您来说是一个可行的选择,请查看Rails 安装程序

于 2013-04-20T03:59:10.863 回答