无法安装 kgio gem 2.9.2?请帮忙?

Cannot install kgio gem 2.9.2 ? Help please?

我从 github 克隆了几个月前用 mac 电脑制作的网站。现在我正在使用 windows 我决定 运行

bundle install

但是我无法下载 kgio gem 2.9.2 版。

这是来自 C:\RailsInstaller\Ruby2.0.0\lib\ruby\gems.0.0\gems\kgio-2.9.2\ext\kgioC:\RailsInstaller\Ruby2.0 的日志。 0\lib\ruby\gems.0.0\gems\kgio-2.9.2\ext\kgio:

C:/RailsInstaller/Ruby2.0.0/bin/ruby.exe 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:/RailsInstaller/Ruby2.0.0/bin/ruby
--with-rtlib
--without-rtlib
--with-nsllib
--without-nsllib
--with-socketlib
--without-socketlib

这是我的gem文件:

source 'http://rubygems.org'
ruby '2.0.0'
#ruby-gemset=railstutorial_rails_4_0
gem 'rails', '4.0.8'
gem 'bcrypt','3.1.7'
gem 'bootstrap-sass', '3.2.0.0'
gem 'sprockets', '2.11.0'
gem 'carrierwave',             '0.10.0'
gem 'mini_magick',             '3.8.0'
gem 'fog',                     '1.23.0'
gem 'sorcery'
gem 'will_paginate',           '3.0.7'
gem 'bootstrap-will_paginate', '0.0.10'
gem 'sunspot_rails'
gem 'progress_bar'

group :development, :test do
gem 'sqlite3', '1.3.8'
gem 'rspec-rails', '2.13.1'
gem 'sunspot_solr'
end
group :test do
gem 'selenium-webdriver', '2.35.1'
gem 'capybara', '2.1.0'
end
gem 'sass-rails', '4.0.3'
gem 'uglifier', '2.1.1'
gem 'coffee-rails', '4.0.1'
gem 'jquery-rails', '3.0.4'
gem 'turbolinks', '1.1.1'
gem 'jbuilder', '1.0.2'
group :doc do
gem 'sdoc', '0.3.20', require: false
end
group :production do
gem 'pg', '0.15.1'
gem 'rails_12factor', '0.0.2'
gem 'unicorn'
end

这是我的 Gemfile.lock:

GEM
remote: http://rubygems.org/
specs:
actionmailer (4.0.8)
  actionpack (= 4.0.8)
  mail (~> 2.5.4)
actionpack (4.0.8)
  activesupport (= 4.0.8)
  builder (~> 3.1.0)
  erubis (~> 2.7.0)
  rack (~> 1.5.2)
  rack-test (~> 0.6.2)
activemodel (4.0.8)
  activesupport (= 4.0.8)
  builder (~> 3.1.0)
activerecord (4.0.8)
  activemodel (= 4.0.8)
  activerecord-deprecated_finders (~> 1.0.2)
  activesupport (= 4.0.8)
  arel (~> 4.0.0)
activerecord-deprecated_finders (1.0.3)
activesupport (4.0.8)
  i18n (~> 0.6, >= 0.6.9)
  minitest (~> 4.2)
  multi_json (~> 1.3)
  thread_safe (~> 0.1)
  tzinfo (~> 0.3.37)
arel (4.0.2)
bcrypt (3.1.7)
bootstrap-sass (3.2.0.0)
  sass (~> 3.2)
bootstrap-will_paginate (0.0.10)
  will_paginate
builder (3.1.4)
capybara (2.1.0)
  mime-types (>= 1.16)
  nokogiri (>= 1.3.3)
  rack (>= 1.0.0)
  rack-test (>= 0.5.4)
  xpath (~> 2.0)
carrierwave (0.10.0)
  activemodel (>= 3.2.0)
  activesupport (>= 3.2.0)
  json (>= 1.7)
  mime-types (>= 1.16)
childprocess (0.5.5)
  ffi (~> 1.0, >= 1.0.11)
coffee-rails (4.0.1)
  coffee-script (>= 2.2.0)
  railties (>= 4.0.0, < 5.0)
coffee-script (2.3.0)
  coffee-script-source
  execjs
coffee-script-source (1.8.0)
diff-lcs (1.2.5)
erubis (2.7.0)
excon (0.41.0)
execjs (2.2.2)
faraday (0.9.0)
  multipart-post (>= 1.2, < 3)
ffi (1.9.6)
fog (1.23.0)
  fog-brightbox
  fog-core (~> 1.23)
  fog-json
  fog-softlayer
  ipaddress (~> 0.5)
  nokogiri (~> 1.5, >= 1.5.11)
fog-brightbox (0.6.1)
  fog-core (~> 1.22)
  fog-json
  inflecto
fog-core (1.24.0)
  builder
  excon (~> 0.38)
  formatador (~> 0.2)
  mime-types
  net-scp (~> 1.1)
  net-ssh (>= 2.1.3)
fog-json (1.0.0)
  multi_json (~> 1.0)
fog-softlayer (0.3.24)
  fog-core
  fog-json
formatador (0.2.5)
highline (1.6.21)
hike (1.2.3)
i18n (0.6.11)
inflecto (0.0.2)
ipaddress (0.8.0)
jbuilder (1.0.2)
  activesupport (>= 3.0.0)
jquery-rails (3.0.4)
  railties (>= 3.0, < 5.0)
  thor (>= 0.14, < 2.0)
json (1.8.1)
jwt (1.0.0)
kgio (2.9.2)
mail (2.5.4)
  mime-types (~> 1.16)
  treetop (~> 1.4.8)
mime-types (1.25.1)
mini_magick (3.8.0)
  subexec (~> 0.2.1)
mini_portile (0.6.0)
minitest (4.7.5)
multi_json (1.10.1)
multi_xml (0.5.5)
multipart-post (2.0.0)
net-scp (1.2.1)
  net-ssh (>= 2.6.5)
net-ssh (2.9.1)
nokogiri (1.6.3.1)
  mini_portile (= 0.6.0)
oauth (0.4.7)
oauth2 (0.9.4)
  faraday (>= 0.8, < 0.10)
  jwt (~> 1.0)
  multi_json (~> 1.3)
  multi_xml (~> 0.5)
  rack (~> 1.2)
options (2.3.2)
pg (0.15.1)
polyglot (0.3.5)
pr_geohash (1.0.0)
progress_bar (1.0.3)
  highline (~> 1.6.1)
  options (~> 2.3.0)
rack (1.5.2)
rack-test (0.6.2)
  rack (>= 1.0)
rails (4.0.8)
  actionmailer (= 4.0.8)
  actionpack (= 4.0.8)
  activerecord (= 4.0.8)
  activesupport (= 4.0.8)
  bundler (>= 1.3.0, < 2.0)
  railties (= 4.0.8)
  sprockets-rails (~> 2.0)
rails_12factor (0.0.2)
  rails_serve_static_assets
  rails_stdout_logging
rails_serve_static_assets (0.0.2)
rails_stdout_logging (0.0.3)
railties (4.0.8)
  actionpack (= 4.0.8)
  activesupport (= 4.0.8)
  rake (>= 0.8.7)
  thor (>= 0.18.1, < 2.0)
raindrops (0.13.0)
rake (10.3.2)
rdoc (3.12.2)
  json (~> 1.4)
rsolr (1.0.10)
  builder (>= 2.1.2)
rspec-core (2.13.1)
rspec-expectations (2.13.0)
  diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.13.1)
rspec-rails (2.13.1)
  actionpack (>= 3.0)
  activesupport (>= 3.0)
  railties (>= 3.0)
  rspec-core (~> 2.13.0)
  rspec-expectations (~> 2.13.0)
  rspec-mocks (~> 2.13.0)
rubyzip (0.9.9)
sass (3.2.19)
sass-rails (4.0.3)
  railties (>= 4.0.0, < 5.0)
  sass (~> 3.2.0)
  sprockets (~> 2.8, <= 2.11.0)
  sprockets-rails (~> 2.0)
sdoc (0.3.20)
  json (>= 1.1.3)
  rdoc (~> 3.10)
selenium-webdriver (2.35.1)
  childprocess (>= 0.2.5)
  multi_json (~> 1.0)
  rubyzip (< 1.0.0)
  websocket (~> 1.0.4)
sorcery (0.8.6)
  bcrypt (~> 3.1)
  oauth (~> 0.4, >= 0.4.4)
  oauth2 (>= 0.8.0, < 1.0.0)
sprockets (2.11.0)
  hike (~> 1.2)
  multi_json (~> 1.0)
  rack (~> 1.0)
  tilt (~> 1.1, != 1.3.0)
sprockets-rails (2.2.0)
  actionpack (>= 3.0)
  activesupport (>= 3.0)
  sprockets (>= 2.8, < 4.0)
sqlite3 (1.3.8)
subexec (0.2.3)
sunspot (2.1.1)
  pr_geohash (~> 1.0)
  rsolr (~> 1.0.7)
sunspot_rails (2.1.1)
  nokogiri
  rails (>= 3)
  sunspot (= 2.1.1)
sunspot_solr (2.1.1)
thor (0.19.1)
thread_safe (0.3.4)
tilt (1.4.1)
treetop (1.4.15)
  polyglot
  polyglot (>= 0.3.1)
turbolinks (1.1.1)
  coffee-rails
tzinfo (0.3.41)
uglifier (2.1.1)
  execjs (>= 0.3.0)
  multi_json (~> 1.0, >= 1.0.2)
unicorn (4.8.3)
  kgio (~> 2.6)
  rack
  raindrops (~> 0.7)
websocket (1.0.7)
will_paginate (3.0.7)
xpath (2.0.0)
  nokogiri (~> 1.3)

PLATFORMS
ruby

DEPENDENCIES
bcrypt (= 3.1.7)
bootstrap-sass (= 3.2.0.0)
bootstrap-will_paginate (= 0.0.10)
capybara (= 2.1.0)
carrierwave (= 0.10.0)
coffee-rails (= 4.0.1)
fog (= 1.23.0)
jbuilder (= 1.0.2)
jquery-rails (= 3.0.4)
mini_magick (= 3.8.0)
pg (= 0.15.1)
progress_bar
rails (= 4.0.8)
rails_12factor (= 0.0.2)
rspec-rails (= 2.13.1)
sass-rails (= 4.0.3)
sdoc (= 0.3.20)
selenium-webdriver (= 2.35.1)
sorcery
sprockets (= 2.11.0)
sqlite3 (= 1.3.8)
sunspot_rails
sunspot_solr
turbolinks (= 1.1.1)
uglifier (= 2.1.1)
unicorn
will_paginate (= 3.0.7)

我一直在 Linux OS 上顽固地开发 Windows 应用程序,但我也遇到了同样的问题。简而言之,unicorn gem 依赖于 kgio,它仅是 *nix,如 this similar Whosebug 问题中所述。

但是!一切都没有丢失,因为为了在 Windows 上本地 运行 你的项目,你可以使用其他要求不高的 gems - 我用了 thin 一段时间,但后来意识到 RubyMine 会非常乐意使用 WEBrick 加载 Rails 应用程序。如果您有生产 Linux 服务器并想在那里使用 unicorn,但更喜欢在本地使用 thin,您可以按如下方式编辑 Gemfile:

platforms :ruby do
  gem 'unicorn'
end
platforms :mswin do
  gem 'thin'
end

这将根据环境加载适当的 gem。

或者在 Windows 上捆绑安装时,您可以通过 运行 执行以下命令排除包含 unicorn 的组:

bundle install --without production

然后它将停止抱怨 kgio,但您仍然可以 运行 使用 Rails 附带的 WEBrick 服务器来开发您的应用程序(正如我所说,我只在 RubyMine 中这样做过,但我确定您可以 运行 直接从命令行启动它)。