7

我已经下载了一个 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之后,但什么也没发生..

4

3 回答 3

14

kgio 仅适用于 *nix 系统。

kgio 宝石页面:

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

于 2013-01-25T16:27:27.633 回答
3

试试这个

platforms :ruby do # linux

  gem 'unicorn'

end

platforms :mswin do

  # gems specific to windows

end

资料来源: 在 windows 上开发,在 heroku 上运行 unicorn 生产

于 2015-02-04T03:12:39.543 回答
0

我认为您使用的是 Windows 操作系统,因此您需要解决此错误的唯一方法是在您的 gem 文件中注释或删除gem 'unicorn',因为这仅适用于 linux 系统

于 2015-08-17T05:31:13.253 回答