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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T00:35:53+00:00 2026-06-04T00:35:53+00:00

After years of being away from Ruby, I’m back full-force and have just cut

  • 0

After years of being away from Ruby, I’m back full-force and have just cut my first gem, which includes an executable. Everything works like a charm.

The problem I am facing, however, is that I ALSO have a startup script (not part of the gem istelf) that daemonizes the executable. Additionally, I’d also like for the startup script to point the executable at configuration in a place like /var/

To the best of my knowledge, there’s no way with rubygems, gemspec, etc., to specify files getting blown out to other parts of your system during install (e.g. startup script to /etc/init.d, and config to /var/). It certainly wouldn’t make sense if you COULD do that.

So… my question is… what IS the proper procedure for automating the installation of something like this. I’m using RHEL, and am wondering if it’s, perhaps, time for me to get my feet wet with making my first RPM.

Any thoughts?

  • 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-04T00:35:54+00:00Added an answer on June 4, 2026 at 12:35 am

    You can do it. However it is probably not quite the recommended approach. But yes it is possible to run arbitary code during gem installation using the extensions option.

    From the RubyGems Manual:

    Usage
      spec.extensions << 'ext/rmagic/extconf.rb'
    
    Notes
    These files will be run when the gem is installed, causing the 
    C (or whatever) code to be compiled on the user’s machine.
    

    Just place whatever ruby code you need into the extconf.rb (or equivalent) file.

    Examples for building C-extensions from the RubyGems Guides:
    http://guides.rubygems.org/c-extensions/

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

Sidebar

Related Questions

I have once again fleshed out Ruby, after two years of not touching it,
I've just learned the basics of Ruby after being very happy with Python for
I've just got back to MIDP development after some 4 years of .NET 2
After years in embedded programming, I have to develop a Windows app. I dug
I'm working with someone who's looking to get back into programming after several years
Recently I've migrated to Arch Linux, after ~4 years being loyal to Ubuntu. Everything
I'm just starting to try MacVIM as a primary text editor after years of
After being a software developer for 7+ years, I think it is time for
New to .net and loving resharper's refactor capability after many years of being spoilt
After being recommended to use adehabitat to calculate volume of intersection I have stumbled

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.