简体   繁体   中英

Mac OS X Lion Xcode problems using RVM

I had Xcode 4.1 preview 5 working fine but decided to upgrade to the final xcode 4.1 thru the App store. I uninstalled Xcode first...

sudo /Developer/Library/uninstall-devtools –mode=all

Then installed Xcode thru the app store and rebooted.

I also removed RVM completely but... now whenever I try and install a version of Ruby it fails. In the error file i get this:

[2011-07-27 18:29:25]  ./configure --prefix="/Users/holden/.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/holden/.rvm/src/yaml-0.1.4':
configure: error: C compiler cannot create executables
See `config.log' for more details

There is no gcc-4.2 or any other gcc in the /usr/bin directory.

What's up with Xcode?

Apparently even after downloading and "installing" XCode from the Appstore and despite the long process after downloading where it appears to install it and the words "Installed" eventually become displayed next to it in the store. You must still manually install it again within your applications folder before it will work.

Odd.

Just bought a Mac, what I had to do to make it work after installing Xcode and seeing that /usr/bin doesn't have gcc, was: Enter Xcode preferences going over to the downloads tab and install Command Line Tools. After setting up my developer account and downloading the tools I opened terminal and typed

rvm install 1.9.3 --with-gcc=clang

and everything compiled and works.

Note - after running "Install Xcode" I still only have "gcc" in /usr/bin, not gcc-4.2. But still worked fine, /usr/bin/gcc was a symlink to /usr/bin/llvm-gcc-4.2

Guy's answer above seems to fix the problem compiling Ruby in RVM with XCode 4.2 installed completely, and removed for me to install GCC from https://github.com/kennethreitz/osx-gcc-installer . This is preferable for users needing to have both RVM and XCode 4.2 installed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM