【问题标题】:Ruby on Rails: running Typhoeus on Windows 7 (64 bit)Ruby on Rails:在 Windows 7(64 位)上运行 Typhoeus
【发布时间】:2011-06-14 16:21:35
【问题描述】:

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

【问题讨论】:

    标签: ruby-on-rails typhoeus


    【解决方案1】:

    对我有用 (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 工作了。

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

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

    【讨论】:

      【解决方案2】:

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

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

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

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

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

      【讨论】:

        【解决方案3】:

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

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

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 2011-04-03
          • 2011-09-22
          • 1970-01-01
          • 2014-01-10
          • 1970-01-01
          • 2010-09-07
          • 2012-06-10
          相关资源
          最近更新 更多