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

发布于 2024-11-15 09:51:48 字数 1227 浏览 2 评论 0 原文

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

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'

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

旧情别恋 2024-11-22 09:51:48

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

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

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

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

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.

真心难拥有 2024-11-22 09:51:48

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

首先,您需要从 RubyInstaller DevKit rubyinstaller.org/downloads" rel="nofollow">下载页面。
其次,您需要获取 MinGW 的 curl 和开发标头和库,您可以在我们的邮件列表中找到说明:

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

根据记录,同一篇文章提到了用户尝试让 gem 工作的失败情况Windows 和他结束切换到路边。

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

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.

不回头走下去 2024-11-22 09:51:48

如果该 gem 正在寻找 native.so 那么它可能不适用于 Windows,*.so 是 *NIX 相当于 *.dll对于 Windows,“共享对象”或“动态链接库”文件。因此,它可能确实需要 native.dll,或者是构建在平台相关代码上的 gem。看看他们的文档,这只是瞎猜。

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

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文