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

  • SEARCH
  • Home
  • 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 3243244
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:24:35+00:00 2026-05-17T18:24:35+00:00

We have a ruby application that depends on a gem with native extensions (in

  • 0

We have a ruby application that depends on a gem with native extensions (in this specific case Nokogiri). However, for various reasons we cannot install the build prerequisites (such as build-essential, libxslt-dev, ruby-dev, etc) for that gem onto our production host.

Is there a (standard?) way to repackage the gem with the native extensions pre-built?

It should be possible (it seems to be fairly standard to do this for Windows), but I can’t find any documentation on the subject.

Note that we only need to support a single platform, with known versions of all system libraries (Ubuntu 9.04 Server 64 bit, Ruby 1.8.7).

UPDATE:
We’re using Bundler, so we want to still have a gem to install at the end of the day, not a debian package.

  • 1 1 Answer
  • 1 View
  • 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-05-17T18:24:36+00:00Added an answer on May 17, 2026 at 6:24 pm

    Finally found a way to do this for gems that use rake-compiler for building their C extensions (which is most of them).

    You need to do the following on a machine that is identical to the one you want to deploy to, or it simply won’t work:

    Install the build prerequisites for building C extensions:

    # apt-get install build-essentials ruby-dev # ... etc
    # gem install rake-compiler
    

    Unpack the gem you want to rebuild:

    $ gem unpack nokogiri
    

    Build your shiny new precompiled gem:

    $ rake native gem
    

    You can now install the native gem on a machine without any build tools installed:

    $ gem install pkg/nokogiri-1.4.3.1-x86-linux.gem 
    Successfully installed nokogiri-1.4.3.1-x86-linux
    1 gem installed
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a ruby application that executes ant as a subprocess using backtick. This
I have a ruby-on-rails application that wishes to utilise the tumblr gem for adding
I have a Ruby on Rails application that needs to find a home in
I have created a table in my Ruby on Rails application that I am
I have a RoR application (ruby v1.8.7; rails v2.3.5) that is caching a page
I have a Ruby application, and here is my setup: I have this HAML
I have a Ruby on Rails application that I'm developing on my computer, which
I have a Ruby on Rails application that has two active environments, Stage and
I have a Ruby on Rails application that will be a CMS in way
I have a small ruby application that I made on my local machine. It

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.