How do you get libcurl libraries to work with InstantRails? - ruby-on-rails

I'm working on a windows machine and trying to get the curb plugin to work, first thing I realized was I needed the curl library installed on my machine, so that's what I'm looking to do.
I simply downloaded a curl library, a curllib library, and have them located at c:/curl and c:/curllib respectively. I setup my environmental variables, I can execute curl.exe and that works like a beaut. However, my gem still fails with the following.
C:/InstantRails/ruby/bin/ruby.exe extconf.rb install curb
checking for curl-config... no
checking for main() in curl.lib... 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
--srcdir=.
--curdir
--ruby=C:/InstantRails/ruby/bin/ruby
--with-curl-dir
--with-curl-include
--without-curl-include=${curl-dir}/include
--with-curl-lib
--without-curl-lib=${curl-dir}/lib
--with-curllib
--without-curllib
extconf.rb:9: 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:/InstantRails/ruby/lib/ruby/gems/1.8/gems/curb-0.4.4.0 for inspection.
Results logged to C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/curb-0.4.4.0/ext/gem_make.out
Anybody have any ideas?

This ends up to be the best tutorial to get the job done.
http://www.opiumtrail.com/wiki/CurbForWindows/
Things to note:
I compiled using MSVC6, so the
additional steps he had explained for
using a different version didn't
apply.
I had to use the exact gem and libcurl specified on his tutorial
You can probably accomplish what you need using the included HTTP:NET library, in my case I couldn't figure it out using that library.

Related

Can´t install tiny_tds in Windows 10

When I run:
gem install tiny_tds
The output tells me that I need FreeTDS installed. Next, it shows me some configuration options and that I'll probably need an option. The options are the following:
--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:/Ruby31-x64/bin/$(RUBY_BASE_NAME)
--help
--with-freetds-dir
--without-freetds-dir
--with-freetds-include
--without-freetds-include=${freetds-dir}/include
--with-freetds-lib
--without-freetds-lib=${freetds-dir}/lib
--with-sybdb-dir
--without-sybdb-dir
--with-sybdb-include
--without-sybdb-include=${sybdb-dir}/include
--with-sybdb-lib
--without-sybdb-lib=${sybdb-dir}/lib
--with-sybdblib
--without-sybdblib
--with-sybdblib
--without-sybdblib
The problem is that none of the options work. Here´s an example of what happens:
C:\RailsApps>gem install tiny_tds -- --with-freetds-dir
Temporarily enhancing PATH for MSYS/MINGW...
Using msys2 packages: mingw-w64-ucrt-x86_64-freetds
Building native extensions with: '--with-freetds-dir'
This could take a while...
ERROR: Error installing tiny_tds:
ERROR: Failed to build gem native extension.
current directory: C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/tiny_tds-2.1.5/ext/tiny_tds
C:/Ruby31-x64/bin/ruby.exe -I C:/Ruby31-x64/lib/ruby/3.1.0 -r ./siteconf20220308-11104-
42q9r4.rb extconf.rb --with-freetds-dir
*** 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:/Ruby31-x64/bin/$(RUBY_BASE_NAME)
--help
--with-freetds-dir
C:/Ruby31-x64/lib/ruby/3.1.0/mkmf.rb:1807:in `dir_config': undefined method `split' for true:TrueClass (NoMethodError)
defaults = Array === dir ? dir : dir.split(File::PATH_SEPARATOR)
^^^^^^
from extconf.rb:56:in `<main>'
looking for freetds headers in the following directories:
- /opt/local/include
- /opt/local/include/freetds
- /usr/local/include
- /usr/local/include/freetds
looking for freetds library in the following directories:
- /opt/local/lib
- /opt/local/lib/freetds
- /usr/local/lib
- /usr/local/lib/freetds
extconf failed, exit code 1
Gem files will remain installed in C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/tiny_tds-2.1.5 for inspection.
Results logged to C:/Ruby31-x64/lib/ruby/gems/3.1.0/extensions/x64-mingw-ucrt/3.1.0/tiny_tds-2.1.5/gem_make.out
I found an downloaded the FreeTDS binaries to try the Windows manual installation, but I don´t know where to place them or how to use them.
I figured it out thanks to the previous posts, by looking at the freetds windows zipfile and the installed pacman package.
It's probably looking for the include folder headers at C:\Ruby31-x64\msys64\ucrt64\include
However it is at C:\Ruby31-x64\msys64\ucrt64\include\freetds
The .exe files interestingly are at C:\Ruby31-x64\msys64\ucrt64\bin and are found.
gem install tiny_tds -- --with-freetds-include=C:\Ruby31-x64\msys64\ucrt64\include\freetds
also see: Tiny TDS GitHub Issue 503
Well, thanks to Jared Beck, I finally was able to precompile the FreeTDS binaries. I used Ruby on Rails in the past, but never needed to do such thing, so I didn´t know the syntax. I thought that running the command gem install tiny_tds included the FreeTDS installation. Then I noticed the configuration options and tried running gem install tiny_tds -- --with-freetds-dir, but didn´t know that the command required the directory as an argument.
Finally, I downloaded the FreeTDS Windows binary from https://sourceforge.net/projects/freetdswindows/, extracted it in C:, and ran the following command:
gem install tiny_tds -- --with-freetds-dir=C:\freetds-1.00

Can't find libcurl or curl/curl.h while installing 'elance' gem on windows

I have facing some problem with curl and curb on windows.
working on following environment :
ruby 1.9.3
rails 4.0.3
and added 'elance' gem with gemfile but after added this gem got following error. i need a solution for window environment.
Error details :
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension
c:/Ruby193/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:/Ruby193/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}/lib
--with-curllib
--without-curllib
extconf.rb:23:in `<main>': Can't find libcurl or curl/curl.h (RuntimeError)
An error occurred while installing curb (0.8.5), and Bundler cannot continue.
Make sure that `gem install curb -v '0.8.5'` succeeds before bundling.
I am stuck here with this error. can you please any one can resolve and help me out with windows.
Download and install cURL for Windows on the cURL download page - Win32 section. The ZIP-file contains a curl.exe that you can run and it is the required dependancy that you need.

Problem installing LibCurl + LibXML + FeedZirra on Windows XP

I am rails newbie. I am working on Windows XP.
I have this version of ruby.
ruby 1.8.7 (2010-08-16 patchlevel 302) [i386-mingw32]
I have Rails 2.3.8 installed.
I am trying to install feedzirra trying every possible way after watching the Rails Cast 168.
First I tried to install using gem install pauldix-feedzirra. I got this error.
C:\Ruby>gem install pauldix-feedzirra
Building native extensions. This could take a while...
ERROR: Error installing pauldix-feedzirra:
ERROR: Failed to build gem native extension.
C:/Ruby/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:/Ruby/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}/lib
--with-curllib
--without-curllib
extconf.rb:12: 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:/Ruby/lib/ruby/gems/1.8/gems/taf2-curb-0.5.
4.0 for inspection.
Results logged to C:/Ruby/lib/ruby/gems/1.8/gems/taf2-curb-0.5.4.0/ext/gem_make.
out
Next I tried gem install curb. I found this on PaulDix FeedZirra page where he had suggested us that Todd Fisher is working on Ruby binding of libcurl which is called curb
Now, I am getting this error
C:\Ruby>gem install curb
Building native extensions. This could take a while...
ERROR: Error installing curb:
ERROR: Failed to build gem native extension.
C:/Ruby/bin/ruby.exe extconf.rb
"-g -O2 -DFD_SETSIZE=256 $(cflags)"
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:/Ruby/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}/lib
--with-curllib
--without-curllib
extconf.rb:19: 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:/Ruby/lib/ruby/gems/1.8/gems/curb-0.7.8 for
inspection.
Results logged to C:/Ruby/lib/ruby/gems/1.8/gems/curb-0.7.8/ext/gem_make.out
When the error said its because it cant find libcurl or curl/curl.h then I did some googling about it and I found link to Download Wizard. The best option for a rails newbie is to go with curl executable (as suggested ascross various forums and articles) I did that. Extracted the file. Installed the exe file. Now I thought the libcurl problem is solved. But??
Ok, now inorder to install feedzirra, i need to install libxml too. So with a little bit of googling i ended up here at Libxml ruby forge, downloaded the libxml-ruby-1.1.3 gem and placed it in C:\Ruby\bin folder.
Now, thinking that all set, I am ready to go to learn feed parsing, i enter gem install pauldix-feedzirra. I get the same error "Can't find libcurl or curl/curl.h" and the same old list what i got earlier.
For the past 3 days, I am just trying to install this. No luck!
Could someone help me fix this? Basic steps. Please think I dont know how to operate windows. Please go to that basic level when you talk problem fixing terminology and help me to fix this problem.
Looking forward for your help and support in a big way.
Thanks in advance.
Curb Installed
Follow instrictions of rubyinstaller and sakaiproject
You would be able to install curb in no time!
yes, curb she will be install in no time. but not taf2-curb. and taf2-curb - this one need for feedzirra. Look on my fighting with taf2-curb, it wouldnt compile in windows for reason.
BTW, i switched to feedtosis, had some active support issues with feedzirra on edge, do not have time to resolve it.

Problem installing gem pauldix-feedzirra on windows

I am trying to install pauldix-feedzirra gem on windows xp and getting error like this :
Building native extensions. This could take a while...
ERROR: Error installing pauldix-feedzirra:
ERROR: Failed to build gem native extension.
C:/InstantRails-2.0-win/ruby/bin/ruby.exe extconf.rb
checking for curl-config... no
checking for main() in curl.lib... 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
--srcdir=.
--curdir
--ruby=C:/InstantRails-2.0-win/ruby/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}/lib
--with-curllib
--without-curllib
extconf.rb:12: 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:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/taf2-curb-0.5.4.0 for inspection.
Results logged to C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/taf2-curb-0.5.4.0/ext/gem_make.out
Execute Below command and its works
gem install pauldix-feedzirra --platform=mswin32

Gem install on Windows 7

Try to install feedzirra gem
Do this:
gem install pauldix-feedzirra
I get the following error:
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing pauldix-feedzirra:
ERROR: Failed to build gem native extension.
C:/Ruby192/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:/Ruby192/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}/lib
--with-curllib
--without-curllib
extconf.rb:17: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:/Ruby192/lib/ruby/gems/1.9.1/gems/taf2-curb-0.5.4.0 for inspection.
Results logged to C:/Ruby192/lib/ruby/gems/1.9.1/gems/taf2-curb-0.5.4.0/ext/gem_make.out
Ver:
C:\Ruby192>gem -v
1.3.7
C:\Ruby192>ruby -v
ruby 1.9.2p0 (2010-08-18) [i386-mingw32]
Does anyone know how to fix this?
Thanks
It seems you don't have libcurl installed:
checking for curl-config... no
checking for main() in -lcurl... no
Try this: download it and copy everything from the bin directory either to C:\Windows\System32 or %RUBY_ROOT%\bin.
You need to download Curl (binaries and devel). The problem you have is that it can't find the header files that usually are on devel packages.

Resources