Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using curb on Windows #37

Closed
volkanunsal opened this issue Jun 30, 2010 · 7 comments
Closed

Using curb on Windows #37

volkanunsal opened this issue Jun 30, 2010 · 7 comments

Comments

@volkanunsal
Copy link

I am trying to install the curb gem. Since I need to have "A working (lib)curl installation, with development stuff" installed on my computer, I went to the cURL Download Wizard and downloaded this package.

But adding the bin into my PATH did not produce improvement and I still got an error when I try to install the curb gem, such as:

extconf.rb:19: Can't find libcurl or curl/curl.h (RuntimeError)

Even though, curl is already in the PATH.

I also tried raking the gem with this command:

rake install EXTCONF_OPTS='--with-curl-dir=B:\curl'

But all 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: undefined reference to 'imp_curl_formadd'
@volkanunsal
Copy link
Author

Does anyone have an answer for this?

@phiggins
Copy link
Contributor

phiggins commented Jul 6, 2010

@tenaciousflea: I installed curb on a Windows XP machine a few weeks ago, and when I had to do it on a second machine I decided to document my steps in case I had to do it a third time. You can see how I did it over here on my blog.

@volkanunsal
Copy link
Author

The thing is I couldn't find libcurl for mingw32 anywhere. The download page is so complicated for that project, it's hopeless. In the end, I decided to use http://github.com/archiloque/rest-client

@taf2
Copy link
Owner

taf2 commented Jul 22, 2010

Yeah, really anytime you need to compile source on windows... it's not going to be an easy task... I've thought about setting up a mingw32 build environment and cross compiling binary win32 releases of curb, but don't have a need for it, since I don't use windows... if anyone else is interested in supporting it this would be a different story of course...

@ghazel
Copy link
Contributor

ghazel commented Jan 19, 2011

I've had curb working with Windows for some time. To pass extconf args to gem, you need an extra pair of dashes. I used the "Win32 - Generic" package, specifically "Win32 2000/XP 7.21.3 libcurl SSL Günter Knauf 3.02 MB", http://www.gknw.net/mirror/curl/win32/curl-7.21.3-devel-mingw32.zip

gem install curb -- --with-curl-include=c:\Users\Greg\projects\curl-7.21.3-devel-mingw32\include --with-curl-lib=c:\Users\Greg\projects\curl-7.21.3-devel-mingw32\bin

A few notes:

  • curb tends to have some C99 parts, so using MSVC won't work, you have to use DevKit/mingw (sadly)
  • yes, point with-curl-lib at \bin not \lib. I believe this is some DevKit oddity.
  • DevKit (sadly) does not support spaces in paths, so the include and lib dirs can't have them
  • There are probably some directories you could copy (!) the libcurl lib and include files to so that they're picked up automatically, but I don't recommend it

@volkanunsal
Copy link
Author

thanks

@abdufarag
Copy link

I have tried every thing but still cant install curb on Windows 10
C:>gem install curb -- --with-curl-lib="C:/curl-7.27.0-devel-mingw32/bin" --with-curl-include="C:/curl-7.27.0-devel-mingw32/include"
Temporarily enhancing PATH to include DevKit...
Building native extensions with: '--with-curl-lib=C:/curl-7.27.0-devel-mingw32/bin --with-curl-include=C:/curl-7.27.0-devel-mingw32/include'
This could take a while...
ERROR: Error installing curb:
ERROR: Failed to build gem native extension.

C:/Ruby22-x64/bin/ruby.exe -r ./siteconf20170418-13264-4p5aww.rb extconf.rb --with-curl-lib=C:/curl-7.27.0-devel-mingw32/bin --with-curl-include=C:/curl-7.27.0-devel-mingw32/include

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:/Ruby22-x64/bin/$(RUBY_BASE_NAME)
--with-curl-dir
--without-curl-dir
--with-curl-include=${curl-dir}/include
--with-curl-lib=${curl-dir}/lib
--with-curllib
--without-curllib
extconf.rb:18:in `

': 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.

extconf failed, exit code 1

Gem files will remain installed in C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/curb-0.9.3 for inspection.
Results logged to C:/Ruby22-x64/lib/ruby/gems/2.2.0/extensions/x64-mingw32/2.2.0/curb-0.9.3/gem_make.out

jtnegrotto pushed a commit to jtnegrotto/curb that referenced this issue Jun 6, 2023
Refactor: Filter env hash to only have keys of type string
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants