在Windows上使用遏制gem和libcurl [英] Using curb gem and libcurl on Windows
问题描述
我正在尝试安装curb gem,它是Ruby的libcurl绑定,当然我需要在计算机上安装正在运行的(lib)curl安装,其中包含开发内容".因此,我转到了cURL下载向导,并下载了此包.
I am trying to install the curb gem, which is libcurl bindings for Ruby, and of course I need to have "A working (lib)curl installation, with development stuff" installed on my computer. So, I went to the cURL Download Wizard and downloaded this package.
但是将垃圾箱添加到我的PATH中并没有产生任何改善,并且当我尝试安装路缘石时仍然出现错误,例如:
But adding the bin into my PATH does not produce improvement and I still get an error when I try to install the curb gem, such as:
extconf.rb:19:找不到libcurl或curl/curl.h (RuntimeError)
extconf.rb:19: Can't find libcurl or curl/curl.h (RuntimeError)
尽管如此,curl已经在PATH中了.
Even though, curl is already in the PATH.
我还尝试了根据说明进行操作.失败时会说使失败",并抛出诸如此类的错误:
I also tried raking the gem, as per the instructions. It fails saying "make failed" and throwing a bunch of errors like this:
C:/Ruby/lib/ruby/gems/1.8/gems/curb-0.7.7.1/ext/curb_postfield.c:76: 未定义的引用 `_imp__curl_formadd'
C:/Ruby/lib/ruby/gems/1.8/gems/curb-0.7.7.1/ext/curb_postfield.c:76: undefined reference to `_imp__curl_formadd'
推荐答案
我意识到这是一个非常老的问题,但是我今天遇到了这个确切的问题,并在其他人的站点上找到了说明.这些对我有用,所以我想与他们分享,因为有此问题的人最有可能首先遇到StackOverflow:
I realise this is a very old question, but I had this exact problem today and found the instructions on someone else's site. These worked for me so I thought I would share them since people with this issue are most likely to come across StackOverflow first: http://jes.al/2012/10/installing-curb-gem-on-windows-7/
简而言之:
- 获取curl的32位开发版本(请参见下面的注释)
- 将curl bin目录添加到您的PATH
-
运行以下命令(根据需要替换要卷曲的路径)
- Get the 32-bit development version of curl (see my notes below)
- Add the curl bin directory to your PATH
Run the following command (replacing the paths to curl as necessary)
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"
一些个人笔记:
- 即使我使用的是64位Windows 7,也必须在"Win32-Generic"下下载32位的 libcurl 版本,该版本标识为"Win32 2000/XP zip".
- 安装gem时出现错误
c:/Ruby193/lib/ruby/1.9.1/mkmf.rb:246:in 'initialize': Permission denied - mkmftmp1.log (Errno::EACCES)
.这个在此处显示的页面提示它可能是我的防病毒软件出现了问题,只需重试几次即可,确实如此.
- Even though I am on 64-bit Windows 7, I had to download the 32-bit libcurl version under "Win32 - Generic", identified as "Win32 2000/XP zip".
- I got the error
c:/Ruby193/lib/ruby/1.9.1/mkmf.rb:246:in 'initialize': Permission denied - mkmftmp1.log (Errno::EACCES)
while installing the gem. This rather messed up page here suggested that it might be a problem with my anti-virus, and that just retrying a couple of times might work, and indeed, it did.
这篇关于在Windows上使用遏制gem和libcurl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!