安装gem时出错

时间:2014-10-12 18:09:48

标签: ruby-on-rails ruby gem rubygems

我在终端输入'gem install middleman'并收到以下错误消息:

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

        /usr/local/rvm/rubies/ruby-1.9.3-p429/bin/ruby extconf.rb
creating Makefile

make
compiling hitimes.c
make: gcc-4.2: No such file or directory
make: *** [hitimes.o] Error 1


Gem files will remain installed in /usr/local/rvm/gems/ruby-1.9.3-p429/gems/hitimes-1.2.2 for inspection.
Results logged to /usr/local/rvm/gems/ruby-1.9.3-p429/gems/hitimes-1.2.2/ext/hitimes/c/gem_make.out

1 个答案:

答案 0 :(得分:2)

您似乎错过了gcc-4.2

您是否安装了GCC(如果您使用的是Mac,则需要安装Xcode)?

which gcc

如果你已经有一个版本的gcc,你可以简单地符号链接

ln -s /usr/bin/gcc /usr/bin/gcc-4.2