2012-05-19 90 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/ –

相關問題