Lion吃了我的RVM,现在我无法安装Ruby

时间:2011-08-08 18:35:17

标签: ruby-on-rails ruby rvm osx-lion

我最近升级到Lion,一切都很好。甚至重启机器几次。然后在周末,Rails消失了!我的所有宝石都没了。我发誓我不知道发生了什么。它工作得很好。

仔细观察后,RVM本身就消失了。

所以,我重新安装RVM并尝试安装Ruby 1.9.2并得到此错误日志:

[2011-08-08 14:30:41]  ./configure --prefix="/Users/cbmeeks/.rvm/usr"  
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... config/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... no
checking for gcc... /usr/bin/gcc-4.2
checking whether the C compiler works... no
configure: error: in `/Users/cbmeeks/.rvm/src/yaml-0.1.4':
configure: error: C compiler cannot create executables
See `config.log' for more details

看来gcc已经消失了?我不想只是开始随机重新安装所有内容,因为之前一切正常。

有什么想法吗?

感谢。

8 个答案:

答案 0 :(得分:8)

安装Lion后,必须重新安装Xcode / Developer工具。它可以从应用商店购买。

http://itunes.apple.com/us/app/id448457090?mt=12

答案 1 :(得分:6)

如果您不想进行完整的XCode安装,可能需要查看此项目:https://github.com/kennethreitz/osx-gcc-installer

答案 2 :(得分:4)

堆栈溢出摘要

我试图在App Store上的Xcode上安装一个干净的Lion安装上的SiriProxy

我不断收到如下错误: 提供的CC(/ usr / bin / gcc)基于LLVM。

bash-3.2$ rvm install 1.9.3
ERROR: The provided CC(/usr/bin/gcc) is LLVM based, it is not yet fully supported by ruby and gems, please read `rvm requirements`.


在2天后,终于使用这两行:

http://stackoverflow.com/questions/8000145/ruby-rvm-llvm-and-mysql

bash-3.2$ rvm get head
bash-3.2$ CC=/usr/bin/gcc-4.2 rvm install 1.9.3 --enable-shared

在此之前,我曾尝试过关于Ruby和Lion的每篇stackoverflow文章,所以这些可能做了一些设置,帮助了上述两个步骤:

我尝试过的事情包括:

正在运行安装Xcode.app(我已经从App Store下载了 - 运行它进一步安装)

安装

https://github.com/kennethreitz/osx-gcc-installer/downloads may help for installing GCC.

中设置CC

more /Users//.bash_profile

bash-3.2$ more /Users/<USERNAME>/.bash_profile 
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function
export CC=/usr/share/TargetConfigs/bin/gcc

第一行来自SiriProxy安装说明 https://github.com/plamoni/SiriProxy

二线出口CC似乎永远不会起作用。所以不要添加。

它有许多版本指向 我终于使用了CC = / usr / bin / gcc-4.2 rvm install 1.9.3 --enable-shared

答案 3 :(得分:3)

对于使用xCode 4.2.X的用户,您必须添加

export CC=gcc

到你的〜/ .bash_profile。

答案 4 :(得分:1)

尝试从终端运行gcc并查看是否有效?

解决方案可能是重新安装Xcode。

答案 5 :(得分:1)

最新开发版本(rvm get head)将自动使用clang

的LLVM版GCC(ruby 1.9.3-p125+

所以你只需要为旧红宝石下载https://github.com/kennethreitz/osx-gcc-installer

另外注意将osx-gcc-installer与Xcode 4.2.1+混合 - 可能会出现编译/标题错误。

答案 6 :(得分:1)

偶然发现同样的问题。刚做过:

  

rvm get head

     

rvm reload

然后得到

  

rvm install 1.9.3

上班!

这会自动获取p125并编译所有内容。

答案 7 :(得分:1)

我通过在Xcode中安装命令行工具解决了这个问题,就像上面提到的tardate一样。我删除了旧的Xcode并安装了新版本,但没有安装命令行工具。我想指出这一点,因为来自tardate的提示不容易被注意到。