繁体   English   中英

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

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

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

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 .

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

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

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

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

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

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

记录在案,同一篇文章提到了用户试图让 gem 在 Windows 上工作是多么不成功,他最终切换到了遏制。

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

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. 所以它可能真的需要native.dll ,或者是一个基于平台相关代码的 gem。 看看他们的文档,这只是在黑暗中拍摄。

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM