我以前使用Xcode 3附帶的gcc編譯器在Mac上成功安裝了Jekyll gem。不幸的是,我無法將它安裝在現在具有Xcode 4.1的其他Mac上。這臺Mac曾經有Xcode 3,但是我使用命令sudo /Developer-3.2.5/Library/uninstall-devtools --mode=all
卸載了它。自升級到Xcode 4.1後無法安裝Jekyll gem
當試圖sudo gem install jekyll
我得到如下所示的編譯錯誤:
Building native extensions. This could take a while... ERROR: Error installing jekyll: ERROR: Failed to build gem native extension. /usr/local/bin/ruby extconf.rb creating Makefile make gcc -I. -I/usr/local/lib/ruby/1.8/i686-darwin10.3.2 -I/usr/local/lib/ruby/1.8/i686-darwin10.3.2 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -D_XOPEN_SOURCE=1 -fno-common -pipe -fno-common -c porter.c porter.c:31:44: error: stdlib.h: No such file or directory porter.c:32:47: error: string.h: No such file or directory porter.c: In function ‘create_stemmer’: porter.c:85: warning: incompatible implicit declaration of built-in function ‘malloc’ porter.c: In function ‘setto’: porter.c:199: warning: incompatible implicit declaration of built-in function ‘memmove’ make: *** [porter.o] Error 1 Gem files will remain installed in /usr/local/lib/ruby/gems/1.8/gems/fast-stemmer-1.0.0 for inspection. Results logged to /usr/local/lib/ruby/gems/1.8/gems/fast-stemmer-1.0.0/ext/gem_make.out
似乎有在這裏是一個相當基本的問題!我怎樣才能解決這個問題?我使用的是Ruby 1.8.7和RubyGems
1.3.7
1.8.10。
在此先感謝。
有同樣的問題,更新到Xcode 5 Developer Preview幫助。 – NVI