curb gem fails to install. I am using following configuration:-

  • Windows 7

  • Ruby 2

  • Rails 4

  • gem "bundler 1.3.5"

C:\RorProjects>gem install curb

Building native extensions. This could take a while... ERROR: Error installing curb: ERROR: Failed to build gem native extension.

    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
有帮助吗?

解决方案

Try installing mingw and run the command within it, I haven'T worked on windows for a while but it used to fix my gem install problems back then :

http://www.mingw.org/

其他提示

You have to specify the paths to header files and the static library in order to build the extensions. First make sure you have the ruby devkit installed. Then download the x86 package (suffixed 'devel', it's the one that includes all the stuff), extract it somewhere and try gem install curb -- --with-curl-lib=c:/path/to/curl/lib --with-curl-include=c:/path/to/curl/include.

If this one doesn't work (for me it didn't when I tried to install curb with libcurl 7.32.0 and ruby 2.0), you can try downloading the x86 libcurl package here, follow the instruction in the first post to extract it, set up the environment and then run gem install curb -- -with-opt-dir=c:/path/to/libcurl. This got me curb 0.8.5 at the time of this post.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top