Ruby on Rails:在 Windows 7(64 位)上运行 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'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
对我(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 usedSSL
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.
问题似乎是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.如果该 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 neednative.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