Search code examples
ruby-on-railstyphoeus

Ruby on Rails: running Typhoeus on Windows 7 (64 bit)


I can't get Typhoeus gem to work on my Windows 7 machine.

Basically, it doesn't find "native.so" file in "C:/Ruby192/lib/ruby/gems/1.9.1/gems/typhoeus-0.2.4/ext/typhoeus/". How do I fix this?

 C:/Ruby192/lib/ruby/gems/1.9.1/gems/typhoeus-0.2.4/lib/typhoeus.rb:10:in
 `require': 126: The specified module
 could not be found.   -
 C:/Ruby192/lib/ruby/gems/1.9.1/gems/typhoeus-0.2.4/ext/typhoeus/native.so
 (LoadError)    from
 C:/Ruby192/lib/ruby/gems/1.9.1/gems/typhoeus-0.2.4/lib/typhoeus.rb:10:in
 `<top (required)>'     from
 C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.13/lib/bundler/runtime.rb:68:in
 `require'  from
 C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.13/lib/bundler/runtime.rb:68:in
 `block (2 levels) in require'  from
 C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.13/lib/bundler/runtime.rb:66:in
 `each'     from
 C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.13/lib/bundler/runtime.rb:66:in
 `block in require'     from
 C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.13/lib/bundler/runtime.rb:55:in
 `each'     from
 C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.13/lib/bundler/runtime.rb:55:in
 `require'  from
 C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.13/lib/bundler.rb:120:in`require'

Solution

  • The problem seems that typhoeus requires curl as development library to successfully compile it's native.so extension.

    First you need to install RubyInstaller DevKit from downloads page. Second you will need to get curl and development headers and libraries for MinGW, which you can find instructions on our mailing list:

    http://groups.google.com/group/rubyinstaller/browse_thread/thread/c8a4bdb6663cbf7c

    To the record, that same post mentions how unsuccessfully was the user attempt to get the gem to work on Windows and he ended switching to curb.

    PS: while others might say that *.so is UNIX/POSIX convention for shared objects, is the extension Ruby decided to use for Windows C-Extensions, like Python uses *.pyd for their extensions.