我是航站楼的新手所以请耐心等待.已成功完成以下安装(按此特定顺序):
> xCode 4.5
> RVM 1.16
> GCC 4.2.1
> Ruby 1.9.3
当尝试安装Rails(“gem install rails”)时,安装开始,但随后因错误而中断:“无法构建gem native extension”.不知道这是指什么.想法?我还需要事先安装其他东西吗?
在我第一次尝试安装Rails时,我偶然用sudo运行它.这会影响什么吗?
编辑:和输出 –
Building native extensions. This could take a while... ERROR: Error installing rails: ERROR: Failed to build gem native extension. /Users/staffanestberg/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb creating Makefile make compiling generator.c make: /usr/bin/gcc-4.2: No such file or directory make: *** [generator.o] Error 1 Gem files will remain installed in /Users/staffanestberg/.rvm/gems/ruby-1.9.3-p194/gems/json-1.7.5 for inspection. Results logged to /Users/staffanestberg/.rvm/gems/ruby-1.9.3-p194/gems/json-1.7.5/ext/json/ext/generator/gem_make.out
编辑:使用IoUri的建议解决.在.bash-profile中添加export CC = gcc,然后为正确的编译器创建符号链接,
sudo ln -sf /usr/bin/llvm-gcc-4.2 /usr/bin/gcc-4.2