安装Rails时出错

时间:2012-05-03 23:17:13

标签: ruby-on-rails install

我知道其他人已经问过这个,但建议的修补程序似乎对我不起作用。我正在尝试使用Ruby 1.8.7在Mac OS X Lion上安装Rails v.3.2.3。在终端:

$ sudo gem install rails -v 3.2.3

然后我收到错误消息:

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.0 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/json-1.7.0/ext/json/ext/parser/gem_make.out

我见过有人建议安装Xcode v.4.3.2,但我不确定是否需要对Xcode做一些特别的事情才能使Rails安装正常工作。任何帮助表示赞赏。

1 个答案:

答案 0 :(得分:1)

最简单的安装方式是使用RVM 这是一个非常好的指南:

http://thinkvitamin.com/code/ruby-on-rails/installing-ruby-rails-and-mysql-on-os-x-lion/