【发布时间】:2013-04-13 12:58:05
【问题描述】:
所以我尝试在运行 Mountain Lion 的 Mac 上安装 Ruby 1.9.3。我安装了 xCode 并且是最新的。我已经安装了 RVM,现在正在尝试使用 rvm install 1.9.3 安装 Ruby 当我运行它时,它看起来像是要安装但给我一个错误,请参见下文:
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 issuesrvm 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
编辑
不知道发生了什么,但我只是尝试了同样的事情,现在它运行完美。感谢所有留下有用评论的人,非常感谢!
【问题讨论】:
-
先尝试做:
rvm get head然后再尝试安装。 -
顺便说一句,标题错误,您尝试安装的是
Ruby 1.9.3,而不是Rails -
还可以在这里查看一些解决方案:stackoverflow.com/questions/8032824/…
-
您是否安装了 Xcode 命令行工具?它位于“下载”下的 Xcode 首选项中。
-
感谢您的快速回复!我相信我拥有最新版本的 RVM。我刚刚安装了 Xcode 命令工具并再次尝试,但不幸的是没有运气。我也试过做“rvm get head”,同样的事情。我相信这可能与编译器有关,我不确定我是否安装了这个/如何安装它,如果有人可以请让我知道我可以做到并试一试。谢谢!