2013-03-19 54 views
0

第一件事是第一件事,我從我的Mac上安裝了xcode的命令行工具,所以這不是問題。請不要指向我關於這個的其他50篇文章,因爲他們都只是說「安裝命令行工具」。無法在Mac OS Mountain Lion上運行Bundle安裝由於JSON v(1.7.3)gem錯誤

這是我的錯誤,當我運行bundle install

Installing json (1.7.3) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. 

    /usr/local/rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb 
creating Makefile 

make 
compiling parser.c 
make: gcc-4.2: No such file or directory 
make: *** [parser.o] Error 1 


Gem files will remain installed in /usr/local/rvm/gems/ruby-1.9.3-p194/gems/json-1.7.3 for inspection. 
Results logged to /usr/local/rvm/gems/ruby-1.9.3-p194/gems/json-1.7.3/ext/json/ext/parser/gem_make.out 
An error occured while installing json (1.7.3), and Bundler cannot continue. 
Make sure that `gem install json -v '1.7.3'` succeeds before bundling. 

我一直在尋找所有的地方,有些人告訴我安裝install ruby-dev命令,但我還沒有找到一個mac解決方案,因爲我沒有安裝apt-get

此外,看看這個錯誤,它看起來有一個目錄缺少文件試圖去。我不知道該怎麼做呢?

我一直沒有找到一種方法來重新安裝紅寶石。

任何簡單的解決方案呢?

謝謝!

編輯:這是我當地的寶石列表,我運行GCC 4.2.1版,和Ruby版本1.9.3-P194

有什麼奇怪的是,已經有JSON的安裝較新的版本( 1.7.5),所以我不知道它爲什麼要安裝1.7.3,也許有一個gem具有依賴性?我希望我可以跳過那個寶石,並安裝捆綁包的其餘部分。依賴性應該滿足1.7.5,除非寶石需要特定的版本,對吧?

*** LOCAL GEMS *** 

actionmailer (3.2.13, 3.2.7, 3.2.6) 
actionpack (3.2.13, 3.2.7, 3.2.6) 
activemodel (3.2.13, 3.2.7, 3.2.6) 
activerecord (3.2.13, 3.2.7, 3.2.6) 
activeresource (3.2.13, 3.2.7, 3.2.6) 
activesupport (3.2.13, 3.2.7, 3.2.6) 
appscrolls (0.9.0, 0.8.4) 
arel (3.0.2) 
bcrypt-ruby (3.0.1) 
bourne (1.4.0, 1.2.1) 
builder (3.2.0, 3.0.0) 
bundler (1.3.4, 1.1.5) 
coffee-rails (3.2.2) 
coffee-script (2.2.0) 
coffee-script-source (1.6.1, 1.3.3) 
comp_tree (1.1.3) 
devise (2.2.3, 2.1.2) 
draper (1.1.0) 
erubis (2.7.0) 
execjs (1.4.0) 
factory_girl (4.2.0) 
factory_girl_rails (4.2.1) 
hike (1.2.1) 
i18n (0.6.4, 0.6.1, 0.6.0) 
journey (1.0.4) 
jquery-rails (2.2.1, 2.1.1, 2.0.2) 
js-routes (0.8.7) 
json (1.7.5) 
mail (2.5.3, 2.4.4) 
metaclass (0.0.1) 
mime-types (1.21, 1.19) 
mocha (0.13.3, 0.12.7) 
multi_json (1.7.1, 1.3.6) 
orm_adapter (0.4.0) 
polyglot (0.3.3) 
pure (0.2.2) 
rack (1.5.2, 1.4.5, 1.4.1) 
rack-cache (1.2) 
rack-ssl (1.3.3, 1.3.2) 
rack-test (0.6.2, 0.6.1) 
rails (3.2.13, 3.2.7, 3.2.6) 
railties (3.2.13, 3.2.7, 3.2.6) 
rake (10.0.3, 0.9.2.2) 
rdoc (4.0.0, 3.12) 
request_store (1.0.5) 
ruby_parser (3.1.2) 
rubygems-bundler (1.1.1, 1.0.3) 
rvm (1.11.3.6, 1.11.3.5) 
sass (3.2.7, 3.2.1, 3.1.20) 
sass-rails (3.2.6, 3.2.5) 
sexp_processor (4.2.0) 
shoulda (3.4.0) 
shoulda-context (1.0.2) 
shoulda-matchers (1.5.1, 1.5.0) 
simple_form (2.1.0, 2.0.2) 
sprockets (2.9.0, 2.2.2, 2.1.3) 
sqlite3 (1.3.6) 
state_machine (1.1.2) 
thor (0.17.0, 0.16.0, 0.15.4) 
tilt (1.3.6, 1.3.3) 
treetop (1.4.12, 1.4.10) 
tzinfo (0.3.37, 0.3.33) 
uglifier (1.3.0, 1.2.7) 
warden (1.2.1) 
+0

您安裝了哪個'xcode'和'gcc'版本?你有沒有嘗試更新你的'json gem'? (當前版本是1.7.8) – fmendez 2013-03-19 16:55:11

+0

之前,我已經安裝了GCC 4.2.1版。 xcode只需要更新到4.6.1? – 2013-03-19 17:20:48

+0

好吧,xcode現在可以達到4.6.1,但仍然沒有運氣。像我說的GCC是4.2.1版本,這是最新的一個。 – 2013-03-19 19:12:11

回答

1

這聽起來像你沒有安裝GCC。至少有三種方式獲取它:

  1. 去App Store。安裝Xcode。然後,在Xcode中,選擇Xcode>首選項>下載,然後單擊命令行工具旁邊的安裝。

  2. 登錄到Apple開發人員網站,轉到downloads page並下載命令行工具磁盤映像。安裝。

  3. 通過homebrew,macports或從頭編譯安裝GCC。

+0

真棒,即時安裝自制軟件,看看如何工作。但是如果你說GCC應該已經安裝了命令行工具,它沒有,因爲我已經從XCode的下載面板和Apple開發者網站安裝了它們,沒有任何運氣。 – 2013-03-19 16:54:08

+0

安裝GCC48家庭釀造後仍然沒有運氣....任何建議? – 2013-03-19 18:23:53

+0

GCC48 = 4.2.1 BTW – 2013-03-19 19:31:17

相關問題