繁体   English   中英

运行捆绑软件安装时“无法构建gem native扩展”

[英]'Failed to build gem native extension' when running bundle install

当我在项目目录中运行“捆绑安装”时,出现以下错误:

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    c:/Ruby22/bin/ruby.exe -r ./siteconf20161028-11856-1tljde.rb extconf.rb
checking for CLOCK_MONOTONIC in time.h... yes
checking for clockid_t in time.h... yes
checking for clock_gettime() in -lrt... no
checking for t_open() in -lnsl... no
checking for socket() in -lsocket... no
checking for poll() in poll.h... no
checking for getaddrinfo() in sys/types.h,sys/socket.h,netdb.h... no
getaddrinfo required
*** 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=c:/Ruby22/bin/$(RUBY_BASE_NAME)
        --with-rtlib
        --without-rtlib
        --with-nsllib
        --without-nsllib
        --with-socketlib
        --without-socketlib

extconf failed, exit code 1

Gem files will remain installed in c:/Ruby22/lib/ruby/gems/2.2.0/gems/kgio-2.9.2
for inspection.
Results logged to
c:/Ruby22/lib/ruby/gems/2.2.0/extensions/x86-mingw32/2.2.0/kgio-2.9.2/gem_make.out

An error occurred while installing kgio (2.9.2), and Bundler cannot continue.
Make sure that `gem install kgio -v '2.9.2'` succeeds before bundling.

这是我的Gemfile:

source 'https://rubygems.org'

#don't upgrade
gem 'rails', '3.2.11'
gem 'rack', '1.4.0'

ruby '2.2.5'


gem 'rack-attack'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

gem 'sqlite3'
gem 'foreman'

group :development do
  gem 'brakeman'
  gem 'bundler-audit'
  gem 'guard-brakeman'
  gem 'guard-livereload'
  gem 'guard-rspec'
  gem 'guard-shell'
  gem 'pry'
  gem 'rack-livereload'
  gem 'rb-fsevent'
  gem 'travis-lint'
  gem 'better_errors'
  gem 'binding_of_caller'
end

gem 'gauntlt'

gem 'simplecov', :require => false, :group => :test

group :development, :test do
  gem 'launchy'
  gem 'capybara'
  gem 'database_cleaner'
  gem 'poltergeist'
  gem 'rspec-rails', '2.14.2'
end

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails'
  gem 'coffee-rails'
  gem 'jquery-fileupload-rails'
  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer', :platforms => :ruby

  gem 'uglifier'
end

gem 'jquery-rails'

# To use ActiveModel has_secure_password
 gem 'bcrypt'

# To use Jbuilder templates for JSON
# gem 'jbuilder'

# Use unicorn as the app server
 gem 'unicorn'

# Pow related gem
gem 'powder'

gem 'aruba'
#gem 'minitest', '~> 4.0', :require=> "minitest/autorun"

#gem 'minitest'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'debugger'

gem 'execjs'
gem 'therubyracer'

# Add SMTP server support using MailCatcher
gem 'mailcatcher'

我在使用ruby 2.2.5的Windows 10上运行,我不确定是什么版本的rails,原因是当我尝试使用rails -v时出现错误。 我不认为这是我遇到上述错误的原因,因为“ rails -v”错误是最近发生的事情。

您的Gemfile中是否有gem 'unicorn'

麒麟所需的kgio无法安装,我不确定此gem是否可在Window上使用。 尝试将服务器从unicorn更改为thin服务器-可以进行开发。

您也可以在Gemfile中指定宝石的平台

platforms :ruby do #unux
  gem 'unicorn'
end

platforms :mswin do
  #gems specific to windows
end

希望能帮助到你

暂无
暂无

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

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