问题描述
我将独角兽加入到我的Gemfile中,然后当我进行捆绑安装时,出现此错误。
I added unicorn to my Gemfile and after that when i do a bundle install I get this error
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. 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?
推荐答案
问题在于Xcode。转到Xcode设置 - >下载,并确保您已安装命令行工具。一旦我安装了它们, bundle install
就可以运行了。
The problem was Xcode. Go to Xcode settings -> Downloads and make sure you have the "Command Line Tools" installed. Once I installed them, the bundle install
ran just fine.
这篇关于当我进行软件包安装时,我正在为这个gem安装错误获取kgio gem的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!