2014-10-06 207 views
10

上週我在cygwin上做了一個更新,因爲bash是「易受攻擊的問題」。
之後,我無法再編譯sass了。
我試圖重新安裝紅寶石,經過一番安裝失敗,重新安裝cygwin的我安裝了它,並與
更新「寶石更新--system」
運行它,但是當我試圖安裝指南針我得到了以下信息:無法安裝指南針

> /usr/bin/ruby.exe -r ./siteconf20141006-7856-1td7wzb.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=/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 /usr/share/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 
> /usr/share/ruby/2.0.0/mkmf.rb:565:in `try_cpp' from 
> /usr/share/ruby/2.0.0/mkmf.rb:1044:in `block in have_header' from 
> /usr/share/ruby/2.0.0/mkmf.rb:895:in `block in checking_for' from 
> /usr/share/ruby/2.0.0/mkmf.rb:340:in `block (2 levels) in postpone' 
> from /usr/share/ruby/2.0.0/mkmf.rb:310:in `open' from 
> /usr/share/ruby/2.0.0/mkmf.rb:340:in `block in postpone' from 
> /usr/share/ruby/2.0.0/mkmf.rb:310:in `open' from 
> /usr/share/ruby/2.0.0/mkmf.rb:336:in `postpone' from 
> /usr/share/ruby/2.0.0/mkmf.rb:894:in `checking_for' from 
> /usr/share/ruby/2.0.0/mkmf.rb:1043:in `have_header' from 
> extconf.rb:16:in `<main>' 
> 
> extconf failed, exit code 1 

我試圖安裝FFI(「創業板安裝FFI」和「創業板安裝FFI - 事先」),我得到了同樣的消息

這裏是日誌(.gem /紅寶石/擴展/ x86_64的,cygwin的/ ffi-1.9.5/gem_make.out)

package configuration for libffi is not found 
"gcc -o conftest.exe -I/usr/include/ruby-2.0.0 -I/usr/include/ruby-2.0.0/ruby/backward -I/usr/include/ruby-2.0.0 -I. -ggdb -O2 -pipe -Wimplicit-function-declaration conftest.c -L. -L/usr/lib -L. -fstack-protector -lruby200 -lpthread -lrt -ldl -lcrypt " 
checked program was: 
/* begin */ 
1: #include "ruby.h" 
2: 
3: int main(int argc, char **argv) 
4: { 
5: return 0; 
6: } 
/* end */ 

我真的很沮喪!

操作系統Windows 7 64位 Cygwin的

+0

我知道這已經有一段時間了,但是您是否找到了解決此問題的解決方案? – Fred 2015-02-06 18:14:15

回答

2

在OSX這工作:

如果gem install compass失敗,請嘗試

gem install ffi 的情況下,也失敗,錯誤似乎是,該FFI構建看起來/usr/bingcc-4.2

如果您安裝了gcc,只需在/usr/bin之內創建一個符號鏈接打字

sudo ln -s gcc gcc-4.2

否則,你可能需要先安裝gcc(谷歌認爲)

19

是的,對我來說這只是gcc環境,所以你可以嘗試

sudo apt-get install gcc 

,對於工作我在Ubuntu的:)

+0

對於CentOS,'yum install gcc' – 2016-07-31 01:35:27

+5

我不得不使用'sudo apt-get install make'來安裝gcc以外的make。# – 2016-11-10 16:04:00

+0

閱讀問題。 Kornking的操作系統是Windows。 – 2017-08-11 06:00:16

3

確保xcode安裝。

xcode-select --install 

如果已經安裝,請確保您已接受服務條款。

sudo xcodebuild -license 

向下滾動到底部並鍵入同意。

它應該與上述步驟一起工作。

如果出現上述2後做了以下問題步驟

ERROR: While executing gem ... (Errno::EPERM) 
Operation not permitted - /usr/bin/compass 

嘗試以下。

sudo su 
sudo gem install -n /usr/local/bin compass 
+0

如果你真的看過這個問題,你會注意到Kornking的系統是WIndows。所以...沒有XCode。 – 2017-08-11 05:59:40