【问题标题】:gem install kgio ERROR宝石安装 kgio 错误
【发布时间】:2013-01-25 12:33:35
【问题描述】:

我已经下载了一个 Rails 开源 webapp,当我开始使用它时:

C:\Users\admin\Downloads\iCare\icare-develop>rails server
←[31mCould not find kgio-2.8.0 in any of the sources←[0m
←[33mRun `bundle install` to install missing gems.←[0m

我尝试使用以下方法修复此错误:

cmd:>gem install kgio -v '2.8.0'

我得到了错误:

Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing kgio:
ERROR: Failed to build gem native extension.C:/Ruby193/bin/ruby.exe extconf.rb
checking for CLOCK_MONOTONIC in time.h... no
checking for CLOCK_MONOTONIC() in time.h... no
checking for clockid_t in time.h... no
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:/Ruby193/bin/ruby
        --with-rtlib
        --without-rtlib
        --with-nsllib
        --without-nsllib
        --with-socketlib
        --without-socketlib

和 Gem 文件将继续安装在 C:/Ruby193/lib/ruby/gems/1.9.1/gems/kgio-2.8 中。 0 用于检查。 结果记录到 C:/Ruby193/lib/ruby/gems/1.9.1/gems/kgio-2.8.0/ext/kgio/gem_ma ke.out

之后我确实输入了:bundle install,但什么也没发生..

【问题讨论】:

  • 我在代码部分之间添加了那些“和”,因为我无法提交我的问题

标签: ruby-on-rails ruby gem bundle


【解决方案1】:

kgio 仅适用于 *nix 系统。

kgio gem 页面:

kgio 2.8.0 kgio 为 Ruby 提供非阻塞 I/O 方法,无需 在 EAGAIN 和 EINPROGRESS 上引发异常。它旨在用于 与独角兽和彩虹!机架服务器,但可能被其他人使用 应用程序(在类 Unix 平台上运行)。

【讨论】:

  • 你是对的;我在虚拟安装的 ubuntu 上试了一下,效果很好!
  • 所以我们知道它适用于类 unix 平台......这对我们有什么帮助?如果我不想虚拟安装 ubunto,我怎样才能得到它,所以这个 gem 不安装/不是必需的?
  • 如果您需要在最终应用程序中使用 Unicorn(或类似的)而不是用于开发,请尝试添加到您的 Gemfile:group :production, :test do gem 'unicorn' end
  • 如果您在 Windows 机器上运行,添加组是不够的。按照提示here,使用'platforms :ruby do # linux gem 'unicorn' end platforms :mswin do # gems specific to windows end
【解决方案2】:

试试这个

platforms :ruby do # linux

  gem 'unicorn'

end

platforms :mswin do

  # gems specific to windows

end

来源: Develop on windows, run unicorn in production on heroku

【讨论】:

    【解决方案3】:

    我认为您使用的是 windows 操作系统,因此您只需在 gem 文件中注释或删除 gem 'unicorn' 即可解决此错误,因为这只是适用于 linux 系统

    【讨论】:

      猜你喜欢
      • 2014-11-08
      • 2011-05-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多