7

I've downloaded a rails open source webapp , and while i was starting it using :

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

i tried to fix this error using:

cmd:>gem install kgio -v '2.8.0'

i got the error:

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.

and

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

and Gem files will remain installed in C:/Ruby193/lib/ruby/gems/1.9.1/gems/kgio-2.8. 0 for inspection. Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/gems/kgio-2.8.0/ext/kgio/gem_ma ke.out

i did type:bundle install after, but nothing happened..

Br3x
  • 754
  • 4
  • 10
  • 21
  • i added those 'and' between the codes sections because i couldn't submit my question – Br3x Jan 25 '13 at 12:34

3 Answers3

14

kgio is only for *nix system.

the kgio gem page:

kgio 2.8.0 kgio provides non-blocking I/O methods for Ruby without raising exceptions on EAGAIN and EINPROGRESS. It is intended for use with the Unicorn and Rainbows! Rack servers, but may be used by other applications (that run on Unix-like platforms).

fancyPants
  • 50,732
  • 33
  • 89
  • 96
Carlos Ribeiro
  • 643
  • 6
  • 8
  • u're right; i tried it on ubuntu virtually installed, and it works ! – Br3x Jan 28 '13 at 11:52
  • so we know its for unix-like platforms... how does that help us? if i don't want to virtually install ubunto, how can i get it so this gem doesn't install/isn't required? – user1318135 Jul 10 '13 at 17:14
  • 1
    Should you need to use Unicorn (or similar) in your final application but not for development, try adding to your Gemfile: `group :production, :test do gem 'unicorn' end` – joaoprib Sep 30 '13 at 00:07
  • Adding group will not be enough if you are running on a windows machine. follow the tip [here](http://stackoverflow.com/a/10764443/1461972), using `'platforms :ruby do # linux gem 'unicorn' end platforms :mswin do # gems specific to windows end` – MrWater Oct 21 '13 at 16:16
3

Try this

platforms :ruby do # linux

  gem 'unicorn'

end

platforms :mswin do

  # gems specific to windows

end

Source: Develop on windows, run unicorn in production on heroku

Community
  • 1
  • 1
DJSampat
  • 309
  • 2
  • 8
0

I think you're using windows operating system , so only thing you need to get ride of this error is to comment in or remove the gem 'unicorn' in you gem file as this is only for linux systems

Mani
  • 2,391
  • 5
  • 37
  • 81