Re: [RubyInstaller] Not able to install kgio and run bundle command

4,192 views
Skip to first unread message

Bryan Bibat

unread,
Oct 4, 2012, 10:51:11 PM10/4/12
to rubyin...@googlegroups.com
kgio, like unicorn, is designed to take advantage of features found in Unix-like systems.

In other words, they won't work on Windows.

-bry

On Fri, Oct 5, 2012 at 9:10 AM, Arvind <patil....@gmail.com> wrote:
Hello:

Just installed ruby, gems, rails, rubyinstaller by following instructions from


All tests from this doc passed.

Then tried to run bundle command. But it fails giving following errors.

Fetching gem metadata from http://rubygems.org/..........
Fetching gem metadata from http://rubygems.org/..
Using Platform (0.4.0)
Using open4 (1.3.0)
Using POpen4 (0.1.4)
Using bootstrap-sass (2.1.0.0)
Using chunky_png (1.2.6)
Using fssm (0.2.9)
Using sass (3.2.1)
Using compass (0.12.2)
Using diff-lcs (1.1.3)
Using ffi (1.1.5)
Using haml (3.1.7)
Installing kgio (2.7.4) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension
.

        D:/RubyInstall/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=D:/RubyInstall/Ruby193/bin/ruby
        --with-rtlib
        --without-rtlib
        --with-nsllib
        --without-nsllib
        --with-socketlib
        --without-socketlib


Gem files will remain installed in D:/RubyInstall/Ruby193/lib/ruby/gems/1.9.1/ge
ms/kgio-2.7.4 for inspection.
Results logged to D:/RubyInstall/Ruby193/lib/ruby/gems/1.9.1/gems/kgio-2.7.4/ext
/kgio/gem_make.out
An error occurred while installing kgio (2.7.4), and Bundler cannot continue.
Make sure that `gem install kgio -v '2.7.4'` succeeds before bundling.

THEN RAN THE FOLLOWING

>gem install kgio -v '2.7.4'
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.

        D:/RubyInstall/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=D:/RubyInstall/Ruby193/bin/ruby
        --with-rtlib
        --without-rtlib
        --with-nsllib
        --without-nsllib
        --with-socketlib
        --without-socketlib


Gem files will remain installed in D:/RubyInstall/Ruby193/lib/ruby/gems/1.9.1/ge
ms/kgio-2.7.4 for inspection.
Results logged to D:/RubyInstall/Ruby193/lib/ruby/gems/1.9.1/gems/kgio-2.7.4/ext
/kgio/gem_make.out

What could be the problem? Any help is really appreciated.

Thank you,
Arvind.

--
You received this message because you are subscribed to the Google Groups "RubyInstaller" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyinstaller/-/Cfr8td4ywJQJ.
To post to this group, send email to rubyin...@googlegroups.com.
To unsubscribe from this group, send email to rubyinstalle...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyinstaller?hl=en.



--
Bryan Bibat
Freelance Software Engineer
http://www.bryanbibat.net

Jon

unread,
Oct 4, 2012, 11:04:50 PM10/4/12
to rubyin...@googlegroups.com
> Just installed ruby, gems, rails, rubyinstaller by following instructions
> from
>
> https://github.com/oneclick/rubyinstaller/wiki/Development-Kit
>
> All tests from this doc passed.
>
> Then tried to run bundle command. But it fails giving following errors.
>
> ...SNIP...
>
> THEN RAN THE FOLLOWING
>
> >gem install kgio -v '2.7.4'
> 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.
>
> D:/RubyInstall/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.
>
> ...SNIP...
>
> What could be the problem? Any help is really appreciated.


Hi Arvind,

You were so close to the answer. You just gave up too early and didn't search the web.

The kgio gem only builds/runs on Unix-like systems as documented in the kgio docs (1st sentence) http://bogomips.org/kgio/ It uses functions not natively available on Window systems.

That said, these error messages can be overwhelming at first, but they usually provide enough info to start spelunking. So here's a quickstart for the future.

If a quick web search (like `rubyinstaller kgio fail`) doesn't turn up anything, look at the `mkmf.log` file. It has detailed info on the "checking for..." systems tests shown above. For kgio, the `mkmf.log` file shows that important files like `sys/socket.h` are missing. Also look at the `extconf.rb` file (think of it as the chef that controls cooking up a native C ruby gem) to better understand how the gem author wants to build the native gem. For kgio, `extconf.rb` has lines

have_func("getaddrinfo", %w(sys/types.h sys/socket.h netdb.h)) or
abort "getaddrinfo required"

Basically it says that if problems occur while trying to find the function "getaddrinfo" in one of the listed .h library files, abort the build process. It's also very helpful to search for things from `mkmf.log` that fail such as `windows sys/socket.h`.

Persistence, searching, taking it slow, and not allowing yourself to become overwhelmed with a bunch of new info will take you far.

Jon

---
Fail fast. Fail often. Fail publicly. Learn. Adapt. Repeat.
http://thecodeshop.github.com | http://jonforums.github.com/
twitter: @jonforums

Arvind

unread,
Oct 5, 2012, 5:43:09 PM10/5/12
to rubyin...@googlegroups.com
Hi Jon and Bryan:

Thank you for your prompt reply. Really appreciate it. I guess I will have to
find alternatives to unicorn. I am new to the ruby world but really looking 
forward to learn ruby and rails. Have a great weekend.

Thank you,
Arvind.

Jon

unread,
Oct 5, 2012, 11:59:34 PM10/5/12
to rubyin...@googlegroups.com
> Thank you for your prompt reply. Really appreciate it. I guess I will have
> to find alternatives to unicorn. I am new to the ruby world but really looking
> forward to learn ruby and rails. Have a great weekend.

Play with `thin` and see how it works for you. It plays nicely with RubyInstaller.

C:\Users\Jon\Documents>ruby --version
ruby 1.9.3p277 (2012-09-25 revision 37029) [i386-mingw32]

C:\Users\Jon\Documents>gem i thin
Fetching: thin-1.5.0.gem (100%)
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
Successfully installed thin-1.5.0
1 gem installed

C:\Users\Jon\Documents>type simple2.ru
CONTENT = <<-EOT
<!DOCTYPE html>
<html>
<head>
<title>Hello</title>
</head>
<body>
<h1 style="color:#aa0303;width:400px;margin:0 auto;">Hello World!</h1>
<body>
</html>
EOT

map '/' do
run lambda { |env| [200, {'Content-Type' => 'text/html; charset:utf-8'}, [ CONTENT ]] }
end


C:\Users\Jon\Documents>thin -a "127.0.0.1" -p 8080 -R simple2.ru start
>> Thin web server (v1.5.0 codename Knife)
>> Maximum connections set to 1024
>> Listening on 127.0.0.1:8080, CTRL+C to stop

Arvind

unread,
Oct 6, 2012, 6:25:26 PM10/6/12
to rubyin...@googlegroups.com
Thank you Jon again. Appreciate it. I will give this a try and see what happens.

Thank you,
Arvind.
Reply all
Reply to author
Forward
0 new messages