Question

I am new to ruby. I am trying to install a ruby gem thin. It shows an error in installing the gem. I googled for the error but i could not find a link that addresses my problem.

The error is:

    C:\Users\name\Desktop>ruby -v
    ruby 2.0.0p247 (2013-06-27) [i386-mingw32]

    C:\Users\name\Desktop>gem -v
    2.0.3

    C:\Users\name\Desktop>gem install thin
    Temporarily enhancing PATH to include DevKit...
    Building native extensions.  This could take a while...
    ERROR:  Error installing thin:
            ERROR: Failed to build gem native extension.

        C:/Ruby200/bin/ruby.exe extconf.rb
    checking for main() in -lc... *** 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:/Ruby200/bin/ruby
            --with-thin_parser-dir
            --without-thin_parser-dir
            --with-thin_parser-include
            --without-thin_parser-include=${thin_parser-dir}/include
            --with-thin_parser-lib
            --without-thin_parser-lib=${thin_parser-dir}/
            --with-clib
            --without-clib
    C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:430:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
    You have to install development tools first.
            from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:515:in `try_link0'
            from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:530:in `try_link'
            from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:716:in `try_func'
            from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:946:in `block in have_library'
            from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:891:in `block in checking_for'
            from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:336:in `block (2 levels) in postpone'
            from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:306:in `open'
            from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:336:in `block in postpone'
            from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:306:in `open'
            from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:332:in `postpone'
            from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:890:in `checking_for'
            from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:941:in `have_library'
            from extconf.rb:4:in `<main>'


    Gem files will remain installed in C:/Ruby200/lib/ruby/gems/2.0.0/gems/thin-1.6.0 for inspection.
    Results logged to C:/Ruby200/lib/ruby/gems/2.0.0/gems/thin-1.6.0/ext/thin_parser/gem_make.out

    C:\Users\name\Desktop>

Any help truly appreciated. Thanks.

Was it helpful?

Solution

I resolved the problem by following these steps. Posting this answer as it might be useful for others.

I uninstalled and deleted all the ruby stuff and restarted the machine. Downloaded Ruby 2.0 and Devkit from here http://rubyinstaller.org/downloads/.

Installed ruby and devkit. Install devkit using the instructions given in this link https://github.com/oneclick/rubyinstaller/wiki/Development-Kit.

cd to ruby folder and installed rails, thin gem

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top