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 7792843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T22:18:22+00:00 2026-06-01T22:18:22+00:00

Nokogiri allows for this by specifying the libraries in the install command: gem install

  • 0

Nokogiri allows for this by specifying the libraries in the install command:

gem install nokogiri -- --with-xml2-lib=/home/joe/builds/lib 
                    --with-xml2-include=/home/joe/builds/include/libxml2 
                    --with-xslt-lib=/home/joe/builds/lib 
                    --with-xslt-include=/home/joe/builds/include

I did a little digging through Nokogiri’s source to try to find out how they allow for those options to get passed down from the command to the actual build/installation.

I noticed the use of Rake::ExtensionTask as well as mini_portile, however their use seems to be limited to cross compiling on Windows systems in their code.

Is there some bit of code I can throw in my gem to allow users to specify the library they want to link against at install time? How did nokogiri allow for this?

  • 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-01T22:18:23+00:00Added an answer on June 1, 2026 at 10:18 pm

    This is using the dir_config method of the mkmf library.

    The gem install command uses any arguments after -- as arguments to the build command, so they get passes to your extconf.rb.

    Note you still need to use have_library or find_library in order to actually link to the library.

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

Sidebar

Related Questions

I'm trying to install the Nokogiri gem under an RVM managed Ruby 1.8.7 installation
When I try to install nokogiri gem on ruby-1.8.7-p334 [ x86_64 ] on Mac
I'm using nokogiri with an xml document that looks something like this: <songs> <song>
This Ruby code using Nokogiri doc.xpath(//tbody).remove removes the children of the <tbody> (as well
I'm newbie to Nokogiri ruby gem. I'm wondering how to read and write back
I am parsing some XML using Nokogiri and XPath. When I do this: doc.xpath('//Order/child::node()').each
I am trying to install nokogiri locally on dreamhost using the commands: $ wget
I'm using Nokogiri for an assignment and I'm struggling to figure this out. It's
I have this nokogiri object: element.first => #<Nokogiri::XML::Element:0x3fc0cf8ac4b8 name=a attributes=[#<Nokogiri::XML::Attr:0x3fc0cf8ac454 name=class value=fl>, #<Nokogiri::XML::Attr:0x3fc0cf8ac42c name=id
I am new to nokogiri, but it looks like this would be the tool

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.