【问题标题】:unable to install compass无法安装指南针
【发布时间】:2014-11-30 14:33:46
【问题描述】:

上周由于 bash “易受攻击的问题”,我在 cygwin 中进行了更新。
之后,我无法再编译 sass。
我尝试重新安装 ruby​​,在某些安装失败并重新安装 cygwin 后,我安装了它并使用
“gem update --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(“gem install ffi”和“gem install ffi --pre”),我得到了同样的信息

这里是日志(.gem/ruby/extensions/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 64bit 赛格温

【问题讨论】:

  • 我知道这已经有一段时间了,但是你找到解决这个问题的方法了吗?

标签: ruby cygwin ffi compass


【解决方案1】:

是的,对我来说只是gcc环境,所以你可以试试

sudo apt-get install gcc

这在 ubuntu 中对我有用 :)

【讨论】:

  • 对于 CentOS,yum install gcc
  • 除了 gcc 之外,我还必须使用 sudo apt-get install make 安装 make
  • 阅读问题。 Kornking 的操作系统是 Windows。
【解决方案2】:

确保已安装 xcode。

xcode-select --install

如果已安装,请确保您已接受 TOS。

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

【讨论】:

  • 如果你真的读过这个问题,你会注意到 Kornking 的系统是 WINdows。所以...没有 XCode。
【解决方案3】:

在 OSX 上这有效:

如果gem install compass 失败,请尝试

gem install ffi 如果同样失败,错误似乎是,ffi 构建在/usr/bin 中查找gcc-4.2

如果您安装了 gcc,只需在 /usr/bin 中键入符号链接

sudo ln -s gcc gcc-4.2

否则你可能需要先安装 gcc (google that)

【讨论】:

    【解决方案4】:

    试试这个:

    根据您的 ruby​​ 版本下载并安装 ruby​​ 开发工具包

    http://rubyinstaller.org/downloads/

    如果有任何问题,请在 github 上关注此 wiki。

    https://github.com/oneclick/rubyinstaller/wiki/Development-Kit

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-02-14
      • 1970-01-01
      • 2014-05-17
      • 2013-09-10
      • 2013-06-26
      • 1970-01-01
      相关资源
      最近更新 更多