无法使用rvm在Mountain Lion上安装Ruby [英] Can't install Ruby on Mountain Lion with rvm

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

问题描述

尝试使用rvm在Mountain Lion上安装Ruby,但收到以下错误消息:

Have tried to install Ruby on Mountain Lion using rvm, but got this error message:

ruby-1.9.3-p362 - #extracted to /usr/local/rvm/src/ruby-1.9.3-p362
ruby-1.9.3-p362 - #configuring
Error running 'env LDFLAGS=-L/opt/sm/pkg/active/lib CFLAGS=-I/opt/sm/pkg/active/include CPATH=/opt/sm/pkg/active/include ./configure --enable-shared --disable-install-doc --prefix=/usr/local/rvm/rubies/ruby-1.9.3-p362 --with-opt-dir=/usr/local/rvm/usr', please read /usr/local/rvm/log/ruby-1.9.3-p362/configure.log
There has been an error while running configure. Halting the installation.
ruby-1.9.3-p362 is not installed.
Creating alias default for ruby-1.9.3-p362.
Recording alias default for ruby-1.9.3-p362.
Creating default links/files
ruby-1.9.3-p362 is not installed.
Could not load ruby ruby-1.9.3-p362.
/usr/local/rvm/scripts/alias: line 111: /usr/local/rvm/rubies/ruby-1.9.3-p362/bin/ruby: No such file or directory

我该怎么做才能正确安装Ruby?还安装了Homebrew软件包管理器;有冲突吗?

What can I do to get a proper install of Ruby working? Also have Homebrew package manager installed; is there a conflict?

谢谢.

推荐答案

这可能是由于最新版本的OS X使用LLVM而不是默认使用GCC编译器.

It's probably due to the fact that recent versions of OS X use the LLVM instead of defaulting to the GCC compiler.

尝试一下:

brew update
brew tap homebrew/dupes
brew install apple-gcc42

安装GCC编译器.然后:

to install the GCC compiler. Then:

rvm install 1.9.3 --with-gcc=clang`

如果以前的解决方案不起作用,请尝试在运行rvm install 1.9.3之前尝试以下操作:

If the previous solution doesn't work, try giving the following a try before running rvm install 1.9.3:

export CC=/usr/local/bin/gcc-4.2

以下github页概述了该问题和多种解决方案,已添加到该帖子中以用于文档目的:在OSX 10.8 Mountain Lion上安装RVM/Ruby的安装提示

EDIT 2: The following github page outlines the issue and multiple solutions, added to this post for documentation purposes: Installation tips for RVM/Ruby on OSX 10.8 Mountain Lion

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

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