【问题标题】:Fail to install curb gem in windows7无法在 windows7 中安装遏制 gem
【发布时间】:2013-08-07 10:19:45
【问题描述】:

curb gem 安装失败。 我正在使用以下配置:-

  • Windows 7

  • 红宝石 2

  • Rails 4

  • gem "捆绑器 1.3.5"

C:\RorProjects>gem 安装路边

构建原生扩展。这可能需要一段时间... 错误:安装路缘时出错: 错误:无法构建 gem 原生扩展。

    C:\Users\abc>gem install curb
    Temporarily enhancing PATH to include DevKit...
    Building native extensions.  This could take a while.....
    ERROR:  Error installing curb:
            ERROR: Failed to build gem native extension.

    C:/Rubyinstaller200/bin/ruby.exe extconf.rb
checking for curl-config... no
checking for main() in -lcurl... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=C:/Rubyinstaller200/bin/ruby
        --with-curl-dir
        --without-curl-dir
        --with-curl-include
        --without-curl-include=${curl-dir}/include
        --with-curl-lib
        --without-curl-lib=${curl-dir}/
        --with-curllib
        --without-curllib
extconf.rb:18:in `<main>':   Can't find libcurl or curl/curl.h (RuntimeError)

  Try passing --with-curl-dir or --with-curl-lib and --with-curl-include
  options to extconf.


Gem files will remain installed in C:/Rubyinstaller200/lib/ruby/gems/2.0.0/gems/
curb-0.8.4 for inspection.
Results logged to C:/Rubyinstaller200/lib/ruby/gems/2.0.0/gems/curb-0.8.4/ext/ge
m_make.out

【问题讨论】:

    标签: ruby-on-rails-4 curb


    【解决方案1】:

    尝试安装 mingw 并在其中运行命令,我已经有一段时间没有在 Windows 上工作了,但它曾经修复了我的 gem 安装问题:

    http://www.mingw.org/

    【讨论】:

      【解决方案2】:

      您必须指定头文件和静态库的路径才能构建扩展。首先确保您安装了ruby devkit。然后download x86 包(后缀为'devel',它包含所有东西),将其解压到某处并尝试gem install curb -- --with-curl-lib=c:/path/to/curl/lib --with-curl-include=c:/path/to/curl/include

      如果这个不起作用(对我来说,当我尝试使用 libcurl 7.32.0 和 ruby​​ 2.0 安装遏制时它没有),您可以尝试下载 x86 libcurl 包here,按照说明中的说明进行操作第一篇解压它,设置环境,然后运行gem install curb -- -with-opt-dir=c:/path/to/libcurl。这让我在发这篇文章时遏制了 0.8.5。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2013-04-16
        • 1970-01-01
        • 1970-01-01
        • 2023-03-11
        • 2011-06-28
        • 2013-02-20
        • 2017-06-07
        • 2012-03-25
        相关资源
        最近更新 更多