2015-04-01 143 views
0

我在mac(yosmite)和終端上試圖安裝指南針,所以我可以開始使用sass。我運行:麻煩安裝指南針爲sass/scss

sudo gem install compass 

,並獲得這個巨大的錯誤:

Caspars-MBP:~ casparwylie$ sudo gem install compass 
Building native extensions. This could take a while... 
ERROR: Error installing compass: 
    ERROR: Failed to build gem native extension. 

    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -r ./siteconf20150401-47466-qqmsir.rb extconf.rb 
checking for ffi.h... *** extconf.rb failed *** 
Could not create Makefile due to some reason, probably lack of necessary 
libraries and/or headers. Check the mkmf.log file for more details. You may 
need configuration options. 

Provided configuration options: 
    --with-opt-dir 
    --without-opt-dir 
    --with-opt-include 
    --without-opt-include=${opt-dir}/include 
    --with-opt-lib 
    --without-opt-lib=${opt-dir}/lib 
    --with-make-prog 
    --without-make-prog 
    --srcdir=. 
    --curdir 
    --ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby 
    --with-ffi_c-dir 
    --without-ffi_c-dir 
    --with-ffi_c-include 
    --without-ffi_c-include=${ffi_c-dir}/include 
    --with-ffi_c-lib 
    --without-ffi_c-lib=${ffi_c-dir}/ 
    --with-libffi-config 
    --without-libffi-config 
    --with-pkg-config 
    --without-pkg-config 
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:434:in `try_do': The compiler failed to generate an executable file. (RuntimeError) 
You have to install development tools first. 
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:549:in `block in try_compile' 
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:502:in `with_werror' 
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:549:in `try_compile' 
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:1044:in `block in have_header' 
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:895:in `block in checking_for' 
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:340:in `block (2 levels) in postpone' 
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:310:in `open' 
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:340:in `block in postpone' 
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:310:in `open' 
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:336:in `postpone' 
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:894:in `checking_for' 
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:1043:in `have_header' 
    from extconf.rb:16:in `<main>' 

extconf failed, exit code 1 

Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/ffi-1.9.8 for inspection. 
Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-14/2.0.0/ffi-1.9.8/gem_make.out 

有誰知道什麼可能是怎麼回事?

謝謝。

回答

0

不知道如何在Mac上解決(也許brew?如果可能的話,與紅寶石安裝相同的方式),但在Linux(xubuntu)這裏有同樣的問題。解決如下:

$ sudo apt-get install ruby-dev && libffi-dev 
... 
$ sudo gem install ffi 
Building native extensions. This could take a while... 
Successfully installed ffi-1.9.8 
Parsing documentation for ffi-1.9.8 
Installing ri documentation for ffi-1.9.8 
Done installing documentation for ffi after 0 seconds 
1 gem installed 

整理過指南針這


後後快速搜索MAC(ref):

$ brew install pkg-config libffi 

它可能不夠用,但不要有我的mac atm來試用它