5

我无法让 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'
4

3 回答 3

3

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

解压后,我从NoSSL/SSL目录中获取了 .dll 文件(两者似乎都有效,我SSL只是为了确定)。我将文件复制到 Ruby 的 /bin 目录中,然后 Typhoeus 工作了。

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

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

于 2014-03-06T21:55:47.703 回答
1

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

首先,您需要从下载页面安装RubyInstaller DevKit。其次,您需要获取 MinGW 的 curl 和开发头文件和库,您可以在我们的邮件列表中找到说明:

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

记录在案,同一篇文章提到了用户试图让 gem 在 Windows 上工作的失败程度,他最终切换到了遏制。

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

于 2011-06-14T19:42:08.973 回答
0

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

再说一次,它说在 native.so (LoadError)中发生了一些事情,所以它可能开始执行,idk

于 2011-06-14T16:25:48.863 回答