Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

let rails use load to interpret script/rails

#4008

The current rails command uses exec to run script/rails. This works as long as we are on Unix and script/rails is executable. This patch switches to load, which is portable.

If script/rails is executable and has a shebang pointing to a different vm than the one the rails command runs under, that shebang will have no effect with this approach.

I think that this patch allows us to send the uniform message that the rails command is the way to go nonetheless, and in that edge case people could still run script/rails manually.

Reported by Xavier Noria · February 20th, 2010 @ 01:23 PM

State: committed
Milestone: 3.0.2
Assigned to: DHH DHH
Importance: High

Activity

  1. Xavier Noria
    Xavier Noria
    • Assigned user set to DHH

    Added a new patch that in addition recurses upwards searching for script/rails.

    February 23rd, 2010 @ 12:24 AM

  2. Xavier Noria
    Xavier Noria

    Using load has also issues, because if you have an app running the rails 3.0 gem, and your rails command belongs to the rails 3.1 gem, the rails gem has already been activated to 3.1.

    We pondered options with wycats and the winner was to switch back to exec, but passing the current interpreter. If you need a different vm, or have a custom shebang that needs to be honored you can still run script/rails directly.

    February 23rd, 2010 @ 10:49 PM

  3. Xavier Noria
    Xavier Noria
    • No changes were found…

    February 23rd, 2010 @ 10:56 PM

  4. Xavier Noria
  5. Sam Ruby
    Sam Ruby
    • Milestone cleared.

    My two cents "rails command known not to work on Windows" should be considered a blocker for the next beta.

    February 25th, 2010 @ 04:27 PM

  6. Repository
    Repository
    • State changed from new to committed

    (from [bf0f14579aa793f2ab29ec092c517d04e702dbe3]) let the rails command recurse upwards looking for script/rails, and exec ruby on it for better portability [Xavier Noria] (Closes #4008 let rails use load to interpret script/rails) http://github.com/rails/rails/commit/bf0f14579aa793f2ab29ec092c517d...

    February 25th, 2010 @ 04:32 PM

  7. Jeremy Kemper
    Jeremy Kemper
    • Milestone set to 3.0.2
    • Importance changed from to High

    October 15th, 2010 @ 11:01 PM