Ruby on Rails:在Windows 7(64位)上运行Typhoeus

时间:2011-06-14 16:21:36

标签: ruby-on-rails typhoeus

我无法让Typhoeus gem在我的Windows 7机器上运行。

基本上,它在“C:/Ruby192/lib/ruby/gems/1.9.1/gems/typhoeus-0.2.4/ext/typhoeus/”中找不到“native.so”文件。我该如何解决这个问题?

 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'

3 个答案:

答案 0 :(得分:3)

对我有用的功能(Win7 x64)是从名为Download libcurl.dll (all versions) only的链接下载.dll,在此处找到:http://www.paehl.com/open_source/?CURL_7.35.0

解压缩后,我从NoSSL/SSL目录中获取了.dll文件(似乎工作正常,我使用SSL只是为了确定)。我将文件复制到Ruby的/ bin目录中,而Typhoeus也工作了。

注意:您不能使用.dll的x64版本,因为Ruby是32位的。 Typhoeus没有对x64文件做出反应。

希望这会对某人有所帮助。

答案 1 :(得分:1)

问题似乎是typhoeus需要curl作为开发库来成功编译它的native.so扩展名。

首先,您需要从RubyInstaller DevKit安装downloads page。 其次,您需要获得MinGW的curl和开发标题和库,您可以在我们的邮件列表中找到说明:

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

在记录中,同一篇文章提到用户试图让gem在Windows上工作失败并且他最终切换到路边。

PS:虽然其他人可能会说* .so是共享对象的UNIX / POSIX约定,但Ruby决定用于Windows C-Extensions的扩展,就像Python使用*.pyd作为扩展。

答案 2 :(得分:0)

如果该gem正在寻找native.so那么它可能不适用于Windows,*.so是* NIX相当于*.dll对于Windows“共享对象”或“动态链接库“档案。所以它可能真的需要native.dll,或者是基于平台相关代码构建的gem。看看他们的文档,这只是在黑暗中拍摄的。

然后再说一遍,它说native.so(LoadError)发生了一些事情,所以也许它的开始执行了,idk