Lion ate my RVM and now I can't install Ruby
I recently upgraded to Lion and everything was fine. Even rebooted the machine a few time. Then over the weekend, Rails
was gone! All of my gemsets were gone. I swear I don't know what happened. It WAS working just fine.
After looking closer, RVM itself was gone.
So, I reinstall RVM and try to install Ruby 1.9.2 and I get this error log:
[2011-08-08 14:30:41] ./configure --prefix="/Users/cb开发者_如何学Gomeeks/.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
It appears that gcc is gone? I'd prefer not to just start randomly reinstalling everything since all was working before.
Any ideas?
Thanks.
After you install Lion, you have to re-install Xcode/Developer tools. It is available from the app store.
http://itunes.apple.com/us/app/id448457090?mt=12
If you don't want to do a full XCode install, you might want to check out this project: https://github.com/kennethreitz/osx-gcc-installer
SUMMARY FOR STACK OVERFLOW
I was trying to install SiriProxy on a clean Lion installation on Xcode from App Store
I kept getting errors like : The provided CC(/usr/bin/gcc) is LLVM based.
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`.
After 2 days finally got it working with these two lines:
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
Before that I had tried every stackoverflow article on Ruby and Lion so doing these may have done some setup that helped the above 2 steps work:
Things I tried included:
Running Install Xcode.app (I had downloaded from App Store - running this does futher installation)
Installing
https://github.com/kennethreitz/osx-gcc-installer/downloads may help for installing GCC.
Set up CC in
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
First line came from SiriProxy install instruction https://github.com/plamoni/SiriProxy
2nd line export CC never seemed to work. So dont add.
It had many versions each pointing I finally used CC=/usr/bin/gcc-4.2 rvm install 1.9.3 --enable-shared
For those using xCode 4.2.X you have to add
export CC=gcc
to your ~/.bash_profile.
Try running gcc
from a terminal and see if that works?
The solution is probably to reinstall Xcode.
latest development version (rvm get head
) will automatically use LLVM version of GCC (clang
) for ruby 1.9.3-p125+
so you need to download https://github.com/kennethreitz/osx-gcc-installer only for older rubies.
Also be careful with mixing osx-gcc-installer with Xcode 4.2.1+ - compilation/header errors might occur.
Stumbled on the same problem. Just did:
rvm get head
rvm reload
and then got
rvm install 1.9.3
to work!
This automatically gets p125 and compiles everything fine.
I solved this problem by installing the Command Line Tools in Xcode just as tardate suggested above. I had removed my old Xcode and installed the new version, but had not installed the Command Line Tools. I wanted to point this out because the tip from tardate was not easy to notice.
精彩评论