简体   繁体   English

通过命令行安装'Compass'会收到错误“extconf failed,退出代码1”

[英]Installing 'Compass' via the command line receive error “extconf failed, exit code 1”

Couldn't find an answer to this. 找不到答案。 Running OS X Yosemite Beta v2 运行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并尝试:

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

If you have XCODE installed, you need to open. 如果安装了XCODE,则需要打开。 Because the OS needs to add components and these are added when you open the app. 因为操作系统需要添加组件,所以在打开应用程序时会添加这些组件。

Try again run 再试一次

sudo gem install compass

Enjoy! 请享用!

Got the same issue, also used xcode-select --install but not help. 得到了同样的问题,也使用了xcode-select --install但没有帮助。 I have to download correct dmg from here https://developer.apple.com/downloads/?name=for%20Xcode 我必须从这里下载正确的dmg https://developer.apple.com/downloads/?name=for%20Xcode

在此输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 安装罗盘时出错。 无法构建gem原生扩展(Compass) - Error installing compass. Failed to build gem native extension (Compass) 运行命令“gatsby new gatsby-site”时出现 git 克隆错误 - 命令失败,退出代码为 1 (EPERM): - git clone error when running command 'gatsby new gatsby-site' - Command failed with exit code 1 (EPERM): 终端进程命令未能启动退出代码:0 和退出代码:2 - The terminal process command failed to launch exit code:0 and exit code:2 安装 psycopg2 命令“gcc”失败,退出状态为 1 - Installing psycopg2 command 'gcc' failed with exit status 1 无法构建 gem 本机扩展(安装 Compass) - Failed to build gem native extension (installing Compass) 错误:命令出错,退出状态为 1:在 Pycharm 中安装 pyAudio 时 - ERROR: Command errored out with exit status 1: while installing pyAudio in Pycharm 安装Sublime文本命令行功能时出错 - Error installing Sublime text command line functionality React Native - FBReactNativeSpec 命令 PhaseScriptExecution 失败,退出代码非零 - React Native - FBReactNativeSpec Command PhaseScriptExecution failed with a nonzero exit code Java命令行退出命令? - Java command line exit command? OSX - #include "portaudio.h" 生成 1 个错误。 错误:命令“/usr/bin/clang”失败,退出状态为 1 - OSX - #include "portaudio.h" 1 error generated. error: command '/usr/bin/clang' failed with exit status 1
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM