Possible Duplicate:
OS X Mountain Lion: gcc-4.2 No such file or directory如何安裝rails mac OSX Mountain Lion?
我正面臨着在我的MAC上安裝rails的問題。
我正在學習RoR,但我無法安裝導軌。
這是我做過什麼: 1 - 已安裝的Xcode和下載 '命令行工具'
2 - 安裝RVM與此代碼:
curl -L https://get.rvm.io | bash -s stable
3 - 安裝自制軟件和libksba:
ruby <(curl -fsSkL raw.github.com/mxcl/homebrew/go)
brew install libksba
4 - 安裝Ruby與RVM(RVM命令只有在我重新啓動系統後才起作用):
rvm install 1.9.3
5 - 定義的Ruby 1.9.3默認:
rvm --default 1.9.3
6 - 現在我試圖運行此代碼:
gem install rails
但它返回此錯誤:
Guerreiro:~ rguerreiro$ gem install rails Building native extensions. This could take a while... ERROR: Error installing rails: ERROR: Failed to build gem native extension.
/Users/rguerreiro/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
creating Makefile
make compiling generator.c make: /usr/bin/gcc-4.2: No such file or directory make: *** [generator.o] Error 1
Gem files will remain installed in /Users/rguerreiro/.rvm/gems/ruby-1.9.3-p194/gems/json-1.7.5 for inspection. Results logged to /Users/rguerreiro/.rvm/gems/ruby-1.9.3-p194/gems/json-1.7.5/ext/json/ext/generator/gem_make.out
檢查出[這個問題]的答案(http://stackoverflow.com/questions/12256616/os-x-mountain-lion-gcc-4-2-no-such-file-or-directory):驗證您的XCode和gcc設置。 – rossta
YEAH !!!有效!!!真的非常感謝!請將它發佈爲答案,這樣我就可以標記爲解決方案! –