简体   繁体   中英

Can't install Rails

I'm trying to install Rails on OS X Lion and get the message below. I've installed Ruby and updated to the rubyGems version 1.8.5 too.

Building native extensions.  This could take a while...
ERROR:  Error installing rails:
ERROR: Failed to build gem native extension.

/opt/local/bin/ruby extconf.rb
creating Makefile
make
/usr/bin/gcc-4.2 -I. -I/opt/local/lib/ruby/1.8/i686-darwin10 -I/opt/local/lib/ruby/1.8/i686-darwin10 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -fno-common -O2 -arch x86_64  -fno-common -pipe -fno-common  -O3 -Wall -arch x86_64 -c parser.c
make: /usr/bin/gcc-4.2: No such file or directory
make: *** [parser.o] Error 1

Gem files will remain installed in /opt/local/lib/ruby/gems/1.8/gems/json-1.7.0 for inspection.
Results logged to /opt/local/lib/ruby/gems/1.8/gems/json-1.7.0/ext/json/ext/parser/gem_make.out

It looks like your gcc is missing. Seems to happen in Lion. Try reinstalling XCode and command line tools, or install one via Homebrew

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