2012-01-27 26 views
24

Bạn có quen với lỗi này không? Tôi không có ý tưởng làm thế nào để sửa lỗi này:Không thể xây dựng json (1.6.3) với phần mở rộng gốc sau khi tôi cài đặt Xcode 4.2

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

     /Users/boris/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb creating Makefile 

make /usr/bin/gcc-4.2 -I. 
-I/Users/boris/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/x86_64-darwin10.8.0 
-I/Users/boris/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/ruby/backward 
-I/Users/boris/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wshorten-64-to-32 -Wno-long-long -fno-common -pipe -O3 -Wall -o parser.o -c parser.c make: /usr/bin/gcc-4.2: No such file or directory make: *** [parser.o] Error 1 


Gem files will remain installed in /Users/boris/.rvm/gems/[email protected]/gems/json-1.6.3 for inspection. Results logged to /Users/boris/.rvm/gems/[email protected]/gems/json-1.6.3/ext/json/ext/parser/gem_make.out An error occured while installing json (1.6.3), and Bundler cannot continue. Make sure that `gem install json -v '1.6.3'` succeeds before bundling. 

thông tin hệ thống:

gem -v 
1.8.10 
$ ruby -v 
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin10.8.0] 

Xcode v4.2.1

Trả lời

104

Các makefile tham chiếu /usr/bin/gcc-4.2 ... Tôi giải quyết điều này bằng cách tạo ra một liên kết tượng trưng để thực thi đúng :

sudo ln -s /usr/bin/llvm-gcc-4.2 /usr/bin/gcc-4.2 
+1

Cảm ơn bạn rất nhiều. – ipd

+2

Tôi ước tôi có thể upvote câu trả lời của bạn hai lần! – Stone

+0

Vẫn là câu trả lời! –

Các vấn đề liên quan