5

我的最终目标是安装当前版本的 Ruby on Rails。我在 OS X Mountain Lion 上运行。到目前为止,这是我的过程:

安装的 RVM

$ \curl -L https://get.rvm.io | bash -s stable

检查已知(我假设已批准)安装

$ rvm list known

我看到当前的稳定版本可用

[ruby-]2.0.0[-p247]

输入命令安装

$ rvm install 2.0.0-p247

注意:我也尝试了这些安装命令

$ rvm install ruby-2.0.0-p247
$ rvm install ruby=2.0.0-p247

我的速度很快。结果:

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

我还在调试模式下运行了这个命令。为避免混乱,您可以在此处访问它。

另外,这里是日志:

./configure
current path: /Users/xxxxx/.rvm/src/ruby-2.0.0-p247
command(7): ./configure --prefix=/Users/xxxxx/.rvm/rubies/ruby-2.0.0-p247 --with-opt-dir=/usr/local/opt/libyaml:/usr/local/opt/readline:/usr/local/opt/libksba:/usr/local/opt/openssl --disable-install-doc --without-tcl --without-tk --enable-shared
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/xxxxx/.rvm/src/ruby-2.0.0-p247':
configure: error: C compiler cannot create executables
See `config.log' for more details

这是我第一次通过 RVM 安装。$rvm list 不返回任何宝石。

请询问是否有任何其他信息可能会有所帮助。

编辑-这里是可能对任何人有帮助的日志。

4

3 回答 3

4

我的 Xcode 或我的命令行工具安装一定有问题。重新安装两者使一切运行良好。

于 2013-07-30T00:30:00.153 回答
3

对于那些在您应用与查询相同的错误时从谷歌到达这里的人:

我遇到了同样的问题,但不想像接受的答案所建议的那样经历重新安装 xcode 的漫长过程。我所做的只是运行 然后在我运行之后再次
rvm get stable运行 我原来的问题
rvm install ruby-2.0.0-p247



问题


rvm get stable

解决方案

于 2013-11-13T00:22:40.503 回答
1

确保在 XCode 中安装命令行工具,因为它不会自动安装(是的,我同意,默认情况下应该安装命令行工具),但事实并非如此。

安装 XCode -> 首选项 -> 下载 -> “命令行工具”

EDIT* 错过了整个“让一切都运行得很漂亮的部分”,并把这一切都打了出来-

干杯,很高兴一切顺利!

于 2013-07-30T03:32:25.693 回答