通过命令行安装“Compass”会收到错误“extconf failed,exit code 1” [英] Installing 'Compass' via the command line receive error "extconf failed, exit code 1"

查看:1528
本文介绍了通过命令行安装“Compass”会收到错误“extconf failed,exit code 1”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

无法找到答案。
运行OS X Yosemite Beta v2



遵循指南针安装指南时,请确保您的宝石是最新的

  gem update --system 

然后运行

  gem install指南针


<假设您的安装由于同样的原因而失败,您会注意到错误日志指出:



pre> 您必须先安装开发工具。

因此,安装xcode并尝试:

  xcode-select --install 

按照屏幕指示和你应该是金色的。作为参考,这是我在尝试时收到的错误

 计算机:文件夹用户$ sudo gem install指南针

构建本地扩展。这可能需要一段时间...
错误:安装指南针时出错:
错误:无法构建gem原生扩展。

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -r ./siteconf20140904-3376-i1l5f8.rb extconf.rb
检查ffi。 h ... *** extconf.rb失败***
由于某些原因无法创建Makefile,可能缺少必要的
库和/或头文件。检查mkmf.log文件以获取更多详细信息。您可能
需要配置选项。

提供的配置选项:
--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 ':编译器无法生成可执行文件。 (RuntimeError)
您必须先安装开发工具。
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:从/System/Library/Frameworks/Ruby.framework/Versions/下载`with_werror'
2.0 / usr / lib / ruby​​ / 2.0.0 / mkmf.rb:549:来自/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0的`try_compile'
。 0 / mkmf.rb:1044:在`block in have_header'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:895:在`block block in check_for'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:340:in`block(2 levels)in从/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:310:'open'
from / System / Library / Frameworks / Ruby.framework / Versions / 2.0 / usr / lib / ruby​​ / 2.0.0 / mkmf.rb:340:在`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:从/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:'have_header'
来自extconf.rb:16:'< main>'

extconf失败,退出代码1

Gem文件将会仍然安装在/Library/Ruby/Gems/2.0.0/gems/ffi-1.9.3进行检查。
结果记录到/Library/Ruby/Gems/2.0.0/extensions/universal-darwin-14/2.0.0/ffi-1.9.3/gem_make.out


Couldn't find an answer to this. Running OS X Yosemite Beta v2

When following compass install guide ensure that your gem is up-to-date

gem update --system

Then run

gem install compass 

解决方案

Assuming your installation failed for the same reason as mine, you'll notice that the error logs states:

"You have to install development tools first."

So, install xcode and try:

xcode-select --install

Follow the onscreen instructions and you should be golden. For reference, this is the error I received when attempting

Computer:Folder User$ 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 ./siteconf20140904-3376-i1l5f8.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.3 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-14/2.0.0/ffi-1.9.3/gem_make.out

这篇关于通过命令行安装“Compass”会收到错误“extconf failed,exit code 1”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆