簡體   English   中英

由於JSON v(1.7.3)gem錯誤,無法在Mac OS Mountain Lion上運行捆綁安裝

[英]Cannot run Bundle Install on Mac OS Mountain Lion due to JSON v(1.7.3) gem error

首先,首先,我從Mac上安裝了xcode的命令行工具,所以這不是問題。 請不要指向其他50個帖子,因為它們都只是說“安裝命令行工具”。

這是我運行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

此外,查看錯誤,看起來好像目錄中缺少文件要去的地方。 我不確定該怎么辦?

我也沒有找到一種方法來完全重新安裝ruby。

有什么簡單的解決方案嗎?

萬分感謝!

編輯:這是我的本地gem的列表,我正在運行GCC 4.2.1和Ruby 1.9.3-p194版本

奇怪的是,已經安裝了更新版本的JSON(1.7.5),所以我不知道為什么要嘗試安裝1.7.3,也許有一個具有依賴性的gem? 我希望我可以跳過該步驟,然后安裝其余的軟件包。 依賴關系應該用1.7.5來滿足,除非gem要求使用特定版本,對嗎?

*** 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)

聽起來您沒有安裝GCC。 至少有三種方法可以獲取它:

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

  2. 登錄到Apple Developer站點,轉到下載頁面,然后下載命令行工具磁盤映像。 安裝。

  3. 通過自制軟件,macports或從頭開始編譯來安裝GCC。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM