This project is archived and is in readonly mode.

#1743 ✓invalid
Jeff Cohen

Fix --freeze option

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

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.

Comments and changes to this ticket

  • Jeff Cohen

    Jeff Cohen January 13th, 2009 @ 02:42 AM

    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
  • Pratik

    Pratik January 13th, 2009 @ 03:47 AM

    • Milestone cleared.
    • Assigned user set to “Pratik”
  • Matt Jones

    Matt Jones January 13th, 2009 @ 04:46 AM

    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?

  • Chris Sepic

    Chris Sepic January 13th, 2009 @ 04:48 AM

    Freezing currently works with the option after the path:

    rails appname -f


    rails -f appname

    makes more sense to me.


  • Jeff Cohen

    Jeff Cohen January 13th, 2009 @ 03:30 PM

    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.

  • Pratik

    Pratik January 13th, 2009 @ 03:38 PM

    • State changed from “new” to “invalid”

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href=""></a>

People watching this ticket