Ruby 1.9.3无法安装吗? [英] Ruby 1.9.3 wont install?

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

问题描述

我在安装Ruby 1.9.3时遇到问题,我不知道这是否重要,但是我使用ML POST FACTOR在我的旧Mac上运行os x 10.8

Im having a problem installing Ruby 1.9.3, i dont know if it matters but im using ML POST FACTOR to run os x 10.8 on my older mac

这是我收到的错误

tylers-macbook:~ Tyler$ rvm install 1.9.3
ruby-1.9.3-p547 - #removing src/ruby-1.9.3-p547..
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.8/i386/ruby-1.9.3-p547.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Certificates in '/usr/local/etc/openssl/cert.pem' are already up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/Tyler/.rvm/rubies/ruby-1.9.3-p547, this may take a while depending on your cpu(s)...
ruby-1.9.3-p547 - #downloading ruby-1.9.3-p547, this may take a while depending on your connection...
ruby-1.9.3-p547 - #extracting ruby-1.9.3-p547 to /Users/Tyler/.rvm/src/ruby-1.9.3-p547....
ruby-1.9.3-p547 - #applying patch /Users/Tyler/.rvm/patches/ruby/GH-488.patch.
ruby-1.9.3-p547 - #configuring.
Error running './configure --prefix=/Users/Tyler/.rvm/rubies/ruby-1.9.3-p547 --with-opt-dir=/usr/local/opt/libyaml:/usr/local/opt/readline:/usr/local/opt/libksba:/usr/local/opt/openssl --without-tcl --without-tk --disable-install-doc --enable-shared',
showing last 15 lines of /Users/Tyler/.rvm/log/1408657159_ruby-1.9.3-p547/configure.log
[2014-08-21 17:39:40] ./configure
current path: /Users/Tyler/.rvm/src/ruby-1.9.3-p547
PATH=/usr/local/opt/pkg-config/bin:/usr/local/opt/libtool/bin:/usr/local/opt/automake/bin:/usr/local/opt/autoconf/bin:/Users/Tyler/.apportable/SDK/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/Tyler/.rvm/bin:/Users/Tyler/.rvm/bin
command(7): ./configure --prefix=/Users/Tyler/.rvm/rubies/ruby-1.9.3-p547 --with-opt-dir=/usr/local/opt/libyaml:/usr/local/opt/readline:/usr/local/opt/libksba:/usr/local/opt/openssl --without-tcl --without-tk --disable-install-doc --enable-shared
configure: WARNING: unrecognized options: --without-tcl, --without-tk
checking build system type... i386-apple-darwin12.0.0
checking host system type... i386-apple-darwin12.0.0
checking target system type... i386-apple-darwin12.0.0
checking whether the C compiler works... no
configure: error: in `/Users/Tyler/.rvm/src/ruby-1.9.3-p547':
configure: error: C compiler cannot create executables
See `config.log' for more details
There has been an error while running configure. Halting the installation.

感谢您抽出宝贵时间来帮助

thanks for taking the time to help

config.log

config.log

8/21/14 6:07:04.844 PM com.apple.launchd[1]: (com.apple.sleepservicesd[24476]) Exited: Killed: 9
8/21/14 6:07:04.000 PM kernel[0]: memorystatus_thread: idle exiting pid 24476 [SleepServicesD]
8/21/14 6:07:04.910 PM com.apple.launchd[1]: (com.apple.cfprefsd.xpc.daemon[21]) Exited: Killed: 9
8/21/14 6:07:05.000 PM kernel[0]: memorystatus_thread: idle exiting pid 21 [cfprefsd]
8/21/14 6:07:48.225 PM md5[26610]: BUG in libdispatch:  - 1879 - 0x1b
8/21/14 6:07:48.274 PM md5[26613]: BUG in libdispatch:  - 1879 - 0x1b

推荐答案

您似乎没有C编译器,或者您使用的C编译器不了解RVM使用的某些标志.

It looks like you either don't have a C compiler, or the C compiler you're using doesn't understand some of the flags used by RVM.

此外,您引用的日志是错误的.错误已记录在/Users/Tyler/.rvm/log/1408657159_ruby-1.9.3-p547/configure.log中.

Also, the log you quoted is the wrong one. The error has been logged in /Users/Tyler/.rvm/log/1408657159_ruby-1.9.3-p547/configure.log.

一些用户在注释中建议安装Xcode.
您确实需要安装Xcode才能在Mac上进行软件开发(因为它还会安装其他CLI实用程序),但是您不应使用默认的Xcode编译器来构建Ruby MRI 1.9.3.

Some users have suggested in the comments to install Xcode.
You do need to install Xcode to do software development on your mac (because it also installs other CLI utilities), but you should not use the default Xcode compiler to build Ruby MRI 1.9.3.

Xcode编译器为clang(llvm),但是Ruby MRI 1.9仅支持gcc(另一个较旧但广泛使用的编译器).
确实,MRI 1.9.3与clang非官方的兼容,但是存在一些已知问题,并且某些模块无法正确编译(光纤).

The Xcode compiler is clang (llvm), but Ruby MRI 1.9 only supports gcc (another older but widely used compiler).
While it's true that MRI 1.9.3 is unofficially compatible with clang, there are some known issues and some modules do not compile correctly (Fibers).

clang的完全支持已在MRI 2.0.0中添加.

Full clang support has been added with MRI 2.0.0.

因此,如果您确实要安装MRI 1.9.3,则需要先安装gcc:

So, if you really want to install MRI 1.9.3, you need to install gcc first:

brew update
brew install gcc-4.9

rvm install 1.9.3 --with-gcc=/usr/local/bin/gcc-4.9

这篇关于Ruby 1.9.3无法安装吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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