简体   繁体   English

无法通过RVM(OSX Mountain Lion)安装Ruby 2.0.0-p247

[英]Trouble installing Ruby 2.0.0-p247 via RVM (OSX Mountain Lion)

My ultimate goal is to install the current version of Ruby on Rails. 我的最终目标是安装当前版本的Ruby on Rails。 I am running on OS X Mountain Lion. 我在OS X Mountain Lion上运行。 Here's my process so far: 到目前为止,这是我的流程:

Installed RVM 已安装的RVM

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

Checked for known (and I assume approved) installs 检查已知(并且我认为已批准)安装

$ rvm list known

I see that the current stable build is available 我看到目前稳定的版本可用

[ruby-]2.0.0[-p247]

Key in command to install 键入安装命令

$ rvm install 2.0.0-p247

Note: I also tried these install commands 注意:我也尝试过这些安装命令

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

I'm getting nowhere fast. 我无处可去。 Results: 结果:

$ 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.

I also ran this command in debug mode. 我也在调试模式下运行此命令。 To avoid clutter, you can access it here . 为避免混乱,您可以在此处访问它。

Also, here is the log: 此外,这是日志:

./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

This is my first installation via RVM. 这是我第一次通过RVM安装。 $rvm list returns no gems. $ rvm list不返回任何宝石。

Please ask if any additional information might be helpful. 请询问是否有任何其他信息可能有所帮助。

Edit - HERE is the log in case that might help anyone. 编辑 - HERE是可以帮助任何人的日志。

Something must have been wrong with either my Xcode or my Command Line Tools install. 我的Xcode或我的命令行工具安装肯定有问题。 Reinstalling both made everything run beautifully. 重新安装两者使一切运行得很漂亮。

For those that arrived here from google when you applied the same error as the query: 对于那些从您使用与查询相同的错误从谷歌到达此处的人:

I got this same problem but did not want to go through the ridiculously long process of reinstalling xcode like the accepted answer suggested. 我遇到了同样的问题,但是不想通过重新安装xcode的漫长的过程,如建议的接受的答案。 All I did was run 我所做的就是跑了
rvm get stable And then run rvm get stable然后运行
rvm install ruby-2.0.0-p247 again rvm install ruby-2.0.0-p247再次rvm install ruby-2.0.0-p247

my original problem 我最初的问题

问题

then after I ran 然后我跑了之后
rvm get stable

解

Make sure that you install command line tool within XCode because it does not do it automatically (yes, I agree, command line tool should be installed by default) but it isn't. 确保在XCode中安装命令行工具,因为它不会自动执行(是的,我同意,默认情况下应该安装命令行工具)但事实并非如此。

Install XCode -> Preferences -> Downloads -> "Command Line Tool" 安装XCode - >首选项 - >下载 - >“命令行工具”

EDIT* missed the whole "made everything run beautifully part" and typed this all out- 编辑*错过了整个“让所有东西都运行得很漂亮”并打出这一切 -

Cheers, glad everything worked out! 干杯,很高兴一切顺利!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM