试图安装ruby 1.9.3

时间:2014-11-27 10:20:18

标签: 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

4 个答案:

答案 0 :(得分:4)

正如所讨论的in chat,这似乎解决了这个问题:

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

答案 1 :(得分:2)

我使用以下命令安装了ruby 1.9.3:

rvm install 1.9.3 --with-gcc=gcc

答案 2 :(得分:0)

您可能需要安装x-code并验证是否已更新。

打开它,转到首选项,下载标签,然后点击"安装下一个"到命令行工具包。

答案 3 :(得分:0)

请更新您计算机上的RVM版本。

  rvm get stable