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 lev开发者_开发技巧els) 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'
What worked for me (Win7 x64) was to download the .dll from the link called Download libcurl.dll (all versions) only
, found here: http://www.paehl.com/open_source/?CURL_7.35.0.
After extracting I took the .dll file from the NoSSL/SSL
directory (either seems to work, I used SSL
just to be sure). I copied the file into Ruby's /bin directory and Typhoeus worked.
Note: You can't use the x64 version of the .dll because Ruby is 32-bit. Typhoeus didn't react to the x64 file.
Hopefully this will help someone.
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.
if that gem is looking for native.so
then it might not work with windows, *.so
is the *NIX equivalent of *.dll
for windows a "shared object " or " dynamically linked library" file. So it might really need native.dll
, or be a gem built on platform dependent code. Look at their documentation, this is just a shot in the dark.
then again, it says something happened in native.so ( LoadError) so maybe its begin executed, idk
精彩评论