简体   繁体   English

我执行捆绑安装时遇到kgio gem的宝石安装错误

[英]I am getting this gem install error for kgio gem when i do a bundle install

I added unicorn to my Gemfile and after that when i do a bundle install I get this error 我将独角兽添加到我的Gemfile中,然后在执行捆绑安装时收到此错误

    em::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /Users/adim86/.rvm/rubies/ruby-1.9.3-p0/bin/ruby extconf.rb 
checking for CLOCK_MONOTONIC in time.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
    --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=/Users/adim86/.rvm/rubies/ruby-1.9.3-p0/bin/ruby
/Users/adim86/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
    from /Users/adim86/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:491:in `block in try_compile'
    from /Users/adim86/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:443:in `with_werror'
    from /Users/adim86/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:491:in `try_compile'
    from /Users/adim86/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:686:in `macro_defined?'
    from /Users/adim86/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:822:in `block in have_macro'
    from /Users/adim86/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for'
    from /Users/adim86/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone'
    from /Users/adim86/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:254:in `open'
    from /Users/adim86/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone'
    from /Users/adim86/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:254:in `open'
    from /Users/adim86/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:280:in `postpone'
    from /Users/adim86/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for'
    from /Users/adim86/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:821:in `have_macro'
    from extconf.rb:5:in `<main>'


Gem files will remain installed in /Users/adim86/.rvm/gems/ruby-1.9.3-p0/gems/kgio-2.7.4 for inspection.
Results logged to /Users/adim86/.rvm/gems/ruby-1.9.3-p0/gems/kgio-2.7.4/ext/kgio/gem_make.out
An error occured while installing kgio (2.7.4), and Bundler cannot continue.
Make sure that `gem install kgio -v '2.7.4'` succeeds before bundling

My gem file looks like this. 我的gem文件看起来像这样。 I have tried adding unicorn to a production block but i still get the same error. 我曾尝试将独角兽添加到生产块中,但仍然出现相同的错误。 I have also removed unicorn and i still get the same error also tried a bundle update to no avail: 我也删除了独角兽,但仍然遇到相同的错误,也尝试了更新捆绑包,但无济于事:

source 'https://rubygems.org'

gem 'rails', '3.2.3'

gem 'devise'
gem 'haml-rails'

gem 'omniauth'
gem 'omniauth-twitter'
gem 'omniauth-facebook'
gem 'twitter'
gem 'fb_graph'

gem 'json'
gem 'json_pure'

gem 'simple_form'
gem 'postmark'
gem 'postmark-rails'

gem 'bootstrap-datepicker-rails'
gem 'watu_table_builder', :require => 'table_builder'

gem 'sqlite3'

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'uglifier', '>= 1.0.3'
end

gem "therubyracer", :require => 'v8'

gem 'jquery-rails'

gem 'differ'


gem 'whenever'
gem 'unicorn'

can anyone help? 有人可以帮忙吗?

Unicorn, is designed to take advantage of features found in Unix-like systems. Unicorn旨在利用类似Unix的系统中的功能。

In other words, they won't work on Windows 换句话说,它们在Windows上将无法使用

The problem was Xcode. 问题是Xcode。 Go to Xcode settings -> Downloads and make sure you have the "Command Line Tools" installed. 转到Xcode设置->下载,并确保已安装“命令行工具”。 Once I installed them, the bundle install ran just fine. 一旦我安装了它们, bundle install就可以了。

I've had this problem recently. 我最近有这个问题。 In my case it was because for some unknown reason the environment variable for CC (which is a shim to Apple's LLVM compiler) was not being set. 就我而言,这是因为出于某种未知的原因,未设置CC(它是Apple的LLVM编译器的填充程序)的环境变量。 Typing: 输入:

$ export CC=cc

in the Terminal before doing the bundle install worked for me. 在终端中进行bundle install之前对我有用。

To make the change permanent you can add export CC=cc to your .bash_profile file. 要使更改永久生效,可以将export CC=cc添加到.bash_profile文件中。

If you do the latter, make sure you type: 如果选择后者,请确保键入:

$ source ~/.bash_profile 

(or open a new Terminal window) before doing the bundle install . (或打开新的终端窗口)进行bundle install之前。

this might require newer patchlevel of ruby - like p194 - install it: 这可能需要更新的红宝石补丁p194 -如p194安装它:

rvm install 1.9.3-p194

and try again with it. 然后再试一次。

You should always use the latest patchlevel available, RVM allows to do that with: 您应该始终使用最新的可用补丁程序级别,RVM可以通过以下方式做到这一点:

rvm get stable
rvm use 1.9.3 --install

I used rvm use system to install the gems. 我使用rvm use system安装了gem。 The price of living on the edge with ruby? 生活在红宝石边缘的价格?

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM