无法安装Rails

时间:2012-04-29 06:38:48

标签: ruby-on-rails installation

我正在尝试在OS X Lion上安装Rails并收到以下消息。我已经安装了Ruby并更新到了rubyGems版本1.8.5。

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

1 个答案:

答案 0 :(得分:1)

看起来你的gcc不见了。好像发生在狮子座上。尝试重新安装XCode和命令行工具,或通过Homebrew

安装一个