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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:24:32+00:00 2026-05-23T10:24:32+00:00

I am in the process of building a Rails app that will hook into

  • 0

I am in the process of building a Rails app that will hook into a git repository and will execute some code whenever the repository is pushed to. I am trying to do this using git hooks, but I can’t seem to be able to work with the Rails app from within said hooks.

I have tried using rails runner as the shebang (#!/path/to/rails runner) of the hooks but because the space is not considered an argument separator in shebangs this tries to execute a file called “rails runner” which does not work. I have also tried executing the script as Ruby (#!/usr/bin/ruby) and including the rails config/environment.rb file, but this seems to trigger the old “app/models/X.rb Expected to define X” error. I don’t have the code on me at the moment so I can’t paste the intended functionality to see if there’s just an error in my code somewhere, but I just want to know what the correct approach to executing Rails code outside of the Rails app path is?

Thanks

  • 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-05-23T10:24:33+00:00Added an answer on May 23, 2026 at 10:24 am

    You should be able to use the /usr/bin/env trick:

    #!/usr/bin/env /path/to/rails runner
    

    The env utility just runs its arguments as a normal command, it is usually used to perform PATH searches for things in the shebang.

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

Sidebar

Related Questions

I'm in the process of building a rails app that will basically wrap around
I am in the process of building a facebook app that works through iFrame
I'm building an app in Rails that allows users to upload images to their
I'm in the process of building a mobile web app, and I've run into
I am in the process of building a site that will contain features comparable
I'm in the process of building a site that will help to organize my
I'm building a rails 3.1 app that requires a load of data to be
I am in the process of building a Ruby on Rails based SaaS app.
I'm in the process of building a WPF application and ran into an error
I am in the process of building a rails/flex application which requires audio to

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.