无法使用 RVM 安装 Ruby [英] Unable to install Ruby with RVM

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

问题描述

我在安装带有 RVM 的 Ruby 时遇到问题,这个问题让我很难过.我在 OS Mavericks 上运行,使用最新的 XCode 和 xcode 命令行工具.我在另一台机器上有(据我所知)相同的设置,没有任何问题.

I'm having trouble installing Ruby with RVM, and this one has me stumped. I'm running on OS Mavericks, with the latest XCode and xcode command line tools. I have a (to my knowledge) identical set up on another machine with no problems.

RVM 似乎安装没有问题.

RVM appeared to install with no problems.

在尝试 rvm install 2.1 时,我收到以下错误消息:

Upon an attempt to rvm install 2.1, I received the following error message:

ruby-2.1.1 - #removing src/ruby-2.1.1..
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.9/x86_64/ruby-2.1.1.
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' already are up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/user/.rvm/rubies/ruby-2.1.1, this may take a while depending on your cpu(s)...
ruby-2.1.1 - #downloading ruby-2.1.1, this may take a while depending on your connection...
ruby-2.1.1 - #extracting ruby-2.1.1 to /Users/user/.rvm/src/ruby-2.1.1...
ruby-2.1.1 - #applying patch /Users/user/.rvm/patches/ruby/changeset_r45225.diff.
ruby-2.1.1 - #applying patch /Users/user/.rvm/patches/ruby/changeset_r45240.diff.
ruby-2.1.1 - #configuring.

Error running './configure --prefix=/Users/user/.rvm/rubies/ruby-2.1.1 --with-opt-dir=/usr/local/opt/libyaml:/usr/local/opt/readline:/usr/local/opt/libksba:/usr/local/opt/openssl --enable-shared',
showing last 15 lines of /Users/user/.rvm/log/1394918736_ruby-2.1.1/configure.log
[2014-03-15 21:25:55] ./configure
current path: /Users/user/.rvm/src/ruby-2.1.1
PATH=/usr/local/opt/pkg-config/bin:/usr/local/opt/libtool/bin:/usr/local/opt/automake/bin:/usr/local/opt/autoconf/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/user/.rvm/bin
command(4): ./configure --prefix=/Users/user/.rvm/rubies/ruby-2.1.1 --with-opt-dir=/usr/local/opt/libyaml:/usr/local/opt/readline:/usr/local/opt/libksba:/usr/local/opt/openssl --enable-shared
checking build system type... x86_64-apple-darwin13.1.0
checking host system type... x86_64-apple-darwin13.1.0
checking target system type... x86_64-apple-darwin13.1.0
<stdin>:2:3: error: #error premature clang
        #error premature clang
         ^
1 error generated.
configure: error: clang version 3.0 or later is required
There has been an error while running configure. Halting the installation.

我的第一个想法是运行 RVM 要求,这导致了另一个错误消息

My first thought was to run RVM requirements, which resulted in another error message

Checking requirements for osx.
Installing requirements for osx.
Updating system....
Installing required packages: gcc46.....
Error running 'requirements_osx_brew_libs_install gcc46',
showing last 15 lines of /Users/user/.rvm/log/1394919146/package_install_gcc46.log
+ case "$1" in
+ [[ -t 1 ]]
+ return 1
+ printf %b 'There were package installation errors, make sure to read the log.

Try `brew tap --repair` and make sure `brew doctor` looks reasonable.

Check Homebrew requirements https://github.com/mxcl/homebrew/wiki/Installation\n'
There were package installation errors, make sure to read the log.

Try `brew tap --repair` and make sure `brew doctor` looks reasonable.

Check Homebrew requirements https://github.com/mxcl/homebrew/wiki/Installation
+ case "$_system_version" in
+ return 1
Requirements installation failed with status: 1.

我遵循了这里的建议,现在已经花了几个小时在网上寻找,但还没有解决方案对我有用.任何想法和想法都是最受欢迎的 - 这个让我很难过.

I followed the advice here, and have spent hours now looking online, but no solution yet has worked for me. Any thoughts and ideas are most welcome - this one has me stumped.

推荐答案

安装 gcc46 后,您需要将其设置为默认编译器.您可以在此处找到有关不同方法的信息:将 GCC 4.2 设置为 Mac OS X Leopard 上的默认编译器

Once you have gcc46 insall you need to set it as the default compiler. You can find information on different ways to do that here: Setting GCC 4.2 as the default compiler on Mac OS X Leopard

然后正如输出所说,使用 brew tap --repairbrew doctor 为您提供更多信息.

Then as that output says, use brew tap --repair and brew doctor which gives you more info.

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

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