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.

Fix --freeze option

#1743

I recently discovered the --freeze option when I was reading some of the source code. Unfortunately I also discovered that it appears to have never worked correctly. I would always get an error like this:

/Library/Ruby/Gems/1.8/gems/rails-2.2.2/bin/rails:23:in chdir': can't convert nil into String (TypeError)

from /Library/Ruby/Gems/1.8/gems/rails-2.2.2/bin/rails:23
from /usr/bin/rails:19:in `load'
from /usr/bin/rails:19

This patch fixes it. Now you can do:

rails -f hello

and the app will be frozen to gems.

No idea how to test this other than some ad-hoc testing.

Reported by Jeff Cohen · January 13th, 2009 @ 02:39 AM

State: invalid
Milestone: none
Assigned to: Pratik Pratik
Importance: none

Activity

  1. Jeff Cohen
    Jeff Cohen

    Ugh, formatting messed up. The error I would get would be:

    /Library/Ruby/Gems/1.8/gems/rails-2.2.2/bin/rails:23:in `chdir': can't convert nil into String (TypeError)
    from /Library/Ruby/Gems/1.8/gems/rails-2.2.2/bin/rails:23
    from /usr/bin/rails:19:in `load'
    from /usr/bin/rails:19
    
    

    January 13th, 2009 @ 02:42 AM

  2. Pratik
    Pratik
    • Milestone cleared.
    • Assigned user set to Pratik

    January 13th, 2009 @ 03:47 AM

  3. Matt Jones
    Matt Jones

    Not really solving the problem here - note that 'rails appname --freeze' will work with the current code. The problem is that the option parsing code in app_generator.rb is much smarter than the code in the rails executable.

    Maybe there should be an accessor for app_name on AppGenerator?

    January 13th, 2009 @ 04:46 AM

  4. Chris Sepic
    Chris Sepic

    Freezing currently works with the option after the path:

    rails appname -f

    However

    rails -f appname

    makes more sense to me.

    +1

    January 13th, 2009 @ 04:48 AM

  5. Jeff Cohen
    Jeff Cohen

    Hmmm, maybe I misunderstood. I see now that you're supposed to use the -f after you specify the appname; I thought it was supposed to come before.

    Feel free to close this as invalid if I misunderstood the desired behavior.

    January 13th, 2009 @ 03:30 PM

  6. Pratik
    Pratik
    • State changed from new to invalid

    January 13th, 2009 @ 03:38 PM