在Windows上使用遏制gem和libcurl [英] Using curb gem and libcurl on Windows

查看:112
本文介绍了在Windows上使用遏制gem和libcurl的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试安装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/

简而言之:

  1. 获取curl的32位开发版本(请参见下面的注释)
  2. 将curl bin目录添加到您的PATH
  3. 运行以下命令(根据需要替换要卷曲的路径)

  1. Get the 32-bit development version of curl (see my notes below)
  2. Add the curl bin directory to your PATH
  3. 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"

一些个人笔记:

  • 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆