ruby - 尝试安装 ruby​​ 1.9.3

标签 ruby macos rvm

我的机器上有 Ruby 2.1.4,使用 RVM 安装。我需要使用 Ruby 1.9.3 处理一个项目,但是当我尝试使用 RVM 安装时,我的机器上出现以下错误:

Warning, new version of rvm available '1.26.3', you are using older version '1.26.0'.
You can disable this warning with:    echo rvm_autoupdate_flag=0 >> ~/.rvmrc
You can enable  auto-update  with:    echo rvm_autoupdate_flag=2 >> ~/.rvmrc
ruby-1.9.3-p550 - #removing src/ruby-1.9.3-p550..
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.10/x86_64/ruby-1.9.3-p550.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
WARNING: can't open config file: /usr/local/etc/openssl/openssl.cnf
Certificates in '/usr/local/etc/openssl/cert.pem' are already up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/Jean/.rvm/rubies/ruby-1.9.3-p550, this may take a while depending on your cpu(s)...
ruby-1.9.3-p550 - #downloading ruby-1.9.3-p550, this may take a while depending on your connection...
ruby-1.9.3-p550 - #extracting ruby-1.9.3-p550 to /Users/Jean/.rvm/src/ruby-1.9.3-p550....
ruby-1.9.3-p550 - #applying patch /Users/Jean/.rvm/patches/ruby/GH-488.patch.
ruby-1.9.3-p550 - #configuring.
Error running './configure --prefix=/Users/Jean/.rvm/rubies/ruby-1.9.3-p550 --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/Jean/.rvm/log/1417082976_ruby-1.9.3-p550/configure.log
[2014-11-27 11:09:58] ./configure
current path: /Users/Jean/.rvm/src/ruby-1.9.3-p550
GEM_HOME=/Users/Jean/.rvm/gems/ruby-2.1.4
PATH=/usr/local/opt/pkg-config/bin:/usr/local/opt/libtool/bin:/usr/local/opt/automake/bin:/usr/local/opt/autoconf/bin:/Users/Jean/.rvm/gems/ruby-2.1.4/bin:/Users/Jean/.rvm/gems/ruby-2.1.4@global/bin:/Users/Jean/.rvm/rubies/ruby-2.1.4/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin:/Users/Jean/.rvm/bin
GEM_PATH=/Users/Jean/.rvm/gems/ruby-2.1.4:/Users/Jean/.rvm/gems/ruby-2.1.4@global
command(7): ./configure --prefix=/Users/Jean/.rvm/rubies/ruby-1.9.3-p550 --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-darwin14.0.0
checking host system type... i386-apple-darwin14.0.0
checking target system type... i386-apple-darwin14.0.0
checking whether the C compiler works... no
configure: error: in `/Users/Jean/.rvm/src/ruby-1.9.3-p550':
configure: error: C compiler cannot create executables
See `config.log' for more details
There has been an error while running configure. Halting the installation.

这是我的 config.log 文件:

[2014-11-27 11:09:58] ./configure
current path: /Users/Jean/.rvm/src/ruby-1.9.3-p550
GEM_HOME=/Users/Jean/.rvm/gems/ruby-2.1.4
PATH=/usr/local/opt/pkg-config/bin:/usr/local/opt/libtool/bin:/usr/local/opt/automake/bin:/usr/local/opt/autoconf/bin:/Users/Jean/.rvm/gems/ruby-2.1.4/bin:/Users/Jean/.rvm/gems/ruby-2.1.4@global/bin:/Users/Jean/.rvm/rubies/ruby-2.1.4/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin:/Users/Jean/.rvm/bin
GEM_PATH=/Users/Jean/.rvm/gems/ruby-2.1.4:/Users/Jean/.rvm/gems/ruby-2.1.4@global
command(7): ./configure --prefix=/Users/Jean/.rvm/rubies/ruby-1.9.3-p550 --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-darwin14.0.0
checking host system type... i386-apple-darwin14.0.0
checking target system type... i386-apple-darwin14.0.0
checking whether the C compiler works... no
configure: error: in `/Users/Jean/.rvm/src/ruby-1.9.3-p550':
configure: error: C compiler cannot create executables
See `config.log' for more details

最佳答案

讨论 in chat,这似乎解决了它:

rvm install ruby-1.9.3 --with-gcc=`which gcc`

关于ruby - 尝试安装 ruby​​ 1.9.3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27168173/

相关文章:

linux - 是否可以将一个文件(sym)链接到多个文件?

使用 gem 通过 RVM 安装 Rails 时出现权限错误

ruby-on-rails - 无法降级 bundler

ruby - 同义词的数据结构

ruby - 如何指定 chromedriver 二进制文件的位置

regex - 如何在 OS X 上使用 sed 提取子字符串?

ruby - 如何卸载 RVM?

ruby - 在 watir-webdriver 和 phantomjs 中设置 "Accept-Language" header

ruby - 遍历一个范围

macos - 在 OSX 上加载/执行 ELF 文件的可能性