Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8225181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:19:48+00:00 2026-06-07T15:19:48+00:00

I am trying to build a Ruby C Extensions that uses libcurl. So far

  • 0

I am trying to build a Ruby C Extensions that uses libcurl. So far I have built it sucessfully on Os X. However I am much less experienced developing in Windows and am not exactly sure how to go about doing this.

So far I can compile a Ruby C Extensions using extconf.rb and nmake from the Visual Studio Command Prompt more or less by following these instructions

http://blogs.law.harvard.edu/hoanga/2006/12/14/getting-a-ruby-c-extension-to-compile-on-windows/

However my Extension links libcurl, there is a line in extconf.rb to check for this

# Make sure the cURL library is installed.
have_library("curl")

When creating the makefile, I get

checking for main() in curl.lib... no
creating Makefile

and when running nmake, I get

fatal error C1083: Cannot open include file: 'curl/curl.h': No such file or directory

This is all expected, since its not installed. I have downloaded curl-7.26.0-devel-mingw64 (I think this is appropriate for Windows 7)

I just cant figure out in the Windows environment where I should put either /bin or /include so that my compiler can find them.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T15:19:49+00:00Added an answer on June 7, 2026 at 3:19 pm

    On Windows you can have different compilers, from Visual Studio provided by Microsoft, GCC from MinGW project or Intel compiler.

    RubyInstaller (which I presume is the version of Ruby you’re using) uses GCC (that is why it generates files with mingw in the name)

    Due the way Ruby works, you can’t mix and match compilers. If Ruby was build with GCC, you need GCC to compile.

    Nowdays the recommended approach has been: RubyInstaller + DevKit. DevKit is a convenience package that provides all the tools required to compile Ruby C extensions.

    You can find all this plus installation instructions at RubyInstaller downloads page

    Once you have Ruby and DevKit installed, you can compile most of the extensions that do not depend on external libraries.

    Now, in your particular case, libcurl, RubyInstaller have provided some pre-compiled binaries that works perfectly to install curl-based tools.

    libcurl packages where announced at RubyInstaller group along other packages.

    You will need to download x86-windows package (link in the group page), instructions on how to extract and where to place it can be found in the same link. Please note that libcurl also needs c-ares, zlib and openssl packages.

    For example, to install curb gem, after I extracted the packages I just did:

    gem install curb -- --with-curl-dir=C:/Knapsack/x86-windows
    

    Where C:/Knapsack/x86-windows is the directory I extracted all the binary packages I mentioned before. I’ve also added the bin directory to my PATH so libcurl DLLs can be found and used.

    Note that while Windows uses \ to specify directory separator, you need to use / when providing the option to RubyGems.

    Note 2: In your post you mention downloaded mingw64, which most likely are 64bits binaries. Ruby is a 32bits executable so the packages I recommended are 32bits (x86). At this time RubyInstaller does not provide 64bits (x64) binaries.

    Hope this helps. If you have further questions on installing and using Ruby on Windows, please join RubyInstaller group

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to build my Ruby on Rails project from github on Travis-CI, but
While trying to build the mysql2 gem with ruby 1.9.2-p320 on Fedora 16, I
I'm new to ruby/rails and trying to build a simple Projects / Tags app
I'm trying to build an app using Sinatra, Ruby, rack, haml, pony and SendGrid,
I am trying to build a soccer game to experiment with ruby. The associations
I'm working with a project that uses twitter-bootstrap-rails. This project was built on a
I have a clean build system as follows Ubuntu 11.04 Rvm 1.13.5 Ruby 1.9.3p194
I'm trying to deploy a Rails app that uses Bundler via Capistrano. Running cap
I'm trying to install Nokogiri on a computer that doesn't have Apple's development package
I have been trying to install the Ruby PG gem, but kept getting the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.