gem install kgio 2.9.2错误

时间:2014-04-17 10:03:36

标签: ruby-on-rails ruby

现在当我捆绑安装我的ruby on Rails项目时,它给了我错误

extconf failed, exit code 1

Gem files will remain installed in c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9
.1/gems/kgio-2.9.2 for inspection.
Results logged to c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/extensions/x86
-mingw32/1.9.1/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.

所以任何人都可以帮我在Windows 7中安装 gem install kgio -v' 2.9.2'

当我尝试安装它时总是出现此错误

C:\Sites\vp2.0>gem install kgio -v '2.9.2'
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:/RailsInstaller/Ruby1.9.3/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:/RailsInstaller/Ruby1.9.3/bin/ruby
        --with-rtlib
        --without-rtlib
        --with-nsllib
        --without-nsllib
        --with-socketlib
        --without-socketlib

extconf failed, exit code 1

Gem files will remain installed in C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9
.1/gems/kgio-2.9.2 for inspection.
Results logged to C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/extensions/x86
-mingw32/1.9.1/kgio-2.9.2/gem_make.out

我怎么能解决这些问题?

# 伙伴们现在在DevKit文件夹中的config.yml文件中定义我的ruby版本并尝试使用命令后

gem install kgio -v '2.9.2' --platform=ruby --verbose

我收到了这个错误

C:\Sites\vp2.0>gem install kgio -v '2.9.2' --platform=ruby --verbose
GET https://api.rubygems.org/specs.4.8.gz
302 Moved Temporarily
GET https://s3.amazonaws.com/production.s3.rubygems.org/specs.4.8.gz
200 OK
HEAD https://api.rubygems.org/api/v1/dependencies
200 OK
GET https://api.rubygems.org/api/v1/dependencies?gems=kgio
200 OK
Temporarily enhancing PATH to include DevKit...
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/.document
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/.gitignore
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/.manifest
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/.wrongdoc.yml
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/COPYING
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/ChangeLog
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/GIT-VERSION-FILE

C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/GIT-VERSION-GEN
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/GNUmakefile
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/HACKING
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/ISSUES
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/LATEST
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/LICENSE
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/NEWS
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/README
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/Rakefile
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/TODO
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/ext/kgio/accept.
c
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/ext/kgio/ancient
_ruby.h
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/ext/kgio/autopus
h.c
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/ext/kgio/blockin
g_io_region.h
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/ext/kgio/broken_
system_compat.h
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/ext/kgio/connect
.c
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/ext/kgio/extconf
.rb
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/ext/kgio/kgio.h
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/ext/kgio/kgio_ex
t.c
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/ext/kgio/missing
_accept4.h
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/ext/kgio/my_file
no.h
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/ext/kgio/nonbloc
k.h
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/ext/kgio/poll.c
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/ext/kgio/read.c
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/ext/kgio/set_fil
e_path.h
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/ext/kgio/sock_fo
r_fd.h
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/ext/kgio/tryopen
.c
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/ext/kgio/wait.c
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/ext/kgio/write.c

C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/ext/kgio/writev.
c
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/kgio.gemspec
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/lib/kgio.rb
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/pkg.mk
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/setup.rb
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/test/lib_read_wr
ite.rb
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/test/lib_server_
accept.rb
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/test/test_accept
_class.rb
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/test/test_accept
_flags.rb
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/test/test_autopu
sh.rb
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/test/test_connec
t_fd_leak.rb
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/test/test_cross_
thread_close.rb
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/test/test_defaul
t_wait.rb
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/test/test_kgio_a
ddr.rb
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/test/test_no_dns
_on_tcp_connect.rb
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/test/test_peek.r
b
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/test/test_pipe_p
open.rb
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/test/test_pipe_r
ead_write.rb
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/test/test_poll.r
b
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/test/test_single
ton_read_write.rb
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/test/test_socket
.rb
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/test/test_socket
pair_read_write.rb
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/test/test_syssen
d.rb
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/test/test_tcp6_c
lient_read_server_write.rb
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/test/test_tcp_cl
ient_read_server_write.rb
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/test/test_tcp_co
nnect.rb
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/test/test_tcp_se
rver.rb
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/test/test_tcp_se
rver_read_client_write.rb
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/test/test_tfo.rb

C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/test/test_tryope
n.rb
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/test/test_unix_c
lient_read_server_write.rb
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/test/test_unix_c
onnect.rb
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/test/test_unix_s
erver.rb
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/kgio-2.9.2/test/test_unix_s
erver_read_client_write.rb
Building native extensions.  This could take a while...
C:/RailsInstaller/Ruby1.9.3/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:/RailsInstaller/Ruby1.9.3/bin/ruby
        --with-rtlib
        --without-rtlib
        --with-nsllib
        --without-nsllib
        --with-socketlib
        --without-socketlib
ERROR:  Error installing kgio:
        ERROR: Failed to build gem native extension.

    Building has failed. See above output for more information on the failure.
extconf failed, exit code 1

Gem files will remain installed in C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9
.1/gems/kgio-2.9.2 for inspection.
Results logged to C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/extensions/x86
-mingw32/1.9.1/kgio-2.9.2/gem_make.out

2 个答案:

答案 0 :(得分:3)

将此添加到我的gemfile中对我有用:

platforms :ruby do gem 'unicorn' end

(感谢我现在失去的另一篇文章)

答案 1 :(得分:2)

如果是Linux系统,请使用sudo安装gem。

 sudo gem install kgio -v '2.9.2' --platform=ruby --verbose

如果是Windows机器:

runas /noprofile /user:Administrator gem install kgio -v '2.9.2' --platform=ruby --verbose