2012-05-19 75 views
0

我不知道发生了什么,但我下载的Xcode的OS狮子和我坚持为什么我在Mac OS Lion上遇到此错误?

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.3 for inspection. 
Results logged to /Library/Ruby/Gems/1.8/gems/json-1.7.3/ext/json/ext/parser/gem_make.out 
Jung-Hyun-Jeons-MacBook-Pro:~ peterjeon$ rails -v 
Rails is not currently installed on this system. To get the latest version, simply type: 

$ sudo gem install rails 

You can then rerun your "rails" command. 

回答

1

我建议使用RVM其中一个Ruby版本管理。并使用Ruby的最新版本。

与此单个命令行安装RVM:

curl https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer | bash -s stable 

不要安装它作为根(以避免出现问题),但如果你知道自己在做什么。

安装完成后,安装Ruby:rvm install 1.9.3

然后使用您安装它的版本作为默认值:rvm use 1.9.3 --default
(如果您不使用前缀--default,则每次要使用Ruby时都必须运行该命令)。

希望它有帮助,祝你好运!

+0

另外:非常详细的教程http://moncefbelyamani.com/how-to-install-xcode-homebrew-git-rvm-ruby-on-mac/ –

相关问题