0

我尝试在终端中使用以下命令在 OS X Lion 上安装 Rails:

sudo gem install rails

但我收到以下错误:

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

   /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
    mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h


 Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/json-1.7.6 for inspection.
  Results logged to /Library/Ruby/Gems/1.8/gems/json-1.7.6/ext/json/ext/generator/gem_make.out

任何帮助,将不胜感激。

4

1 回答 1

0

首先在最新的Xcode-Version.

然后运行sudo gem install rails

要安装命令行工具,请转到 XCode Preferences > Downloads。

于 2013-01-18T13:40:40.653 回答