Windows 10 x64中的Ruby curb gem proplem

时间:2017-05-01 08:11:25

标签: ruby windows rubygems curb

我的主要目的是在Windows中执行this ruby​​代码。为此,我使用this方法将curb gem安装到Windows 10。虽然安装没有任何错误,但我正在接受这些消息:

C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': 126: The specified module could not be found.
C:/Ruby22-x64/lib/ruby/gems/2.2.0/extensions/x64-mingw32/2.2.0/curb-0.9.3/curb_core.so (LoadError)
        from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/curb-0.9.3/lib/curl.rb:1:in `<top (required)>'
        from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/curb-0.9.3/lib/curb.rb:1:in `<top (required)>'
        from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `require'
        from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `rescue in require'
        from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:39:in `require'
        from ted-postrank.rb:7:in `<main>'

它出了什么问题?

1 个答案:

答案 0 :(得分:0)

我建议在Windows 10上使用32位版本的ruby,因为64位的某些宝石存在问题。

首先从http://rubyinstaller.org下载32位ruby安装程序并安装它。

然后 下载curl-7.27.0-devel-mingw32,在C:/curl-7.27.0-devel-mingw32中提取 将libcurl.dll和libidn-11.dll复制到Ruby bin目录中。

并安装:

gem install curb --platform=ruby -- --with-curl-lib="C:/curl-7.27.0-devel-mingw32/bin" --with-curl-include="C:/curl-7.27.0-devel-mingw32/include"