# Rails 1.1 and "freeze\_gems"

**URL:** <https://www.ruby-forum.com/t/rails-1-1-and-freeze-gems/89290>\
**Category:** Rails\
**Created:** [March 28, 2006, 7:21pm UTC](https://www.ruby-forum.com/t/rails-1-1-and-freeze-gems/89290 "2006-03-28T19:21:07Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mgreenly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85f322/32.png) [@mgreenly](https://www.ruby-forum.com/u/mgreenly)\
**Post date:** [March 28, 2006, 7:21pm UTC](https://www.ruby-forum.com/t/rails-1-1-and-freeze-gems/89290/1 "2006-03-28T19:21:07Z")

</div>

I’m on OS X Tiger, and just upgraded my gems. I also ran ‘rake  
rails:update’.

After that, I ran “rake freeze\_gems”, I recieve the following:

# ===================== Freezing to the gems for Rails 1.1.0 rm -rf vendor/rails mkdir -p vendor/rails cd vendor/rails Unpacked gem: ‘activesupport-1.3.0’ mv activesupport-1.3.0 activesupport Unpacked gem: ‘activerecord-1.14.0’ mv activerecord-1.14.0 activerecord Unpacked gem: ‘actionpack-1.12.0’ mv actionpack-1.12.0 actionpack Unpacked gem: ‘actionmailer-1.2.0’ mv actionmailer-1.2.0 actionmailer Unpacked gem: ‘actionwebservice-1.1.0’ mv actionwebservice-1.1.0 actionwebservice ERROR: While executing gem … (ArgumentError) Illformed requirement [=#\<Gem::Specification name=rails version=1.1.0\>] rake aborted! exit

Is this a bug, or am I missing something…?

---

<div class="post-metadata">

**Author:** ![mgreenly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85f322/32.png) [@mgreenly](https://www.ruby-forum.com/u/mgreenly)\
**Post date:** [March 28, 2006, 9:08pm UTC](https://www.ruby-forum.com/t/rails-1-1-and-freeze-gems/89290/2 "2006-03-28T21:08:19Z")

</div>

I thought it was just me. FWIW I ran rake again (OS X 10.4.5) with the  
trace option set and got the following:

/opt/local/lib/ruby/vendor\_ruby/1.8/rubygems/user\_interaction.rb:162:in  
`exit' /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/user_interaction.rb:162:in`terminate\_interaction’  
(eval):3:in `terminate_interaction' /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/cmd_manager.rb:71:in`run’  
/opt/local/lib/ruby/vendor\_ruby/1.8/rubygems/gem\_runner.rb:13:in `run' /opt/local/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/tasks/framework.rake:30 /opt/local/lib/ruby/1.8/fileutils.rb:121:in`chdir’  
/opt/local/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:657:in `chdir' /opt/local/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/tasks/framework.rake:24 /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:232:in`execute’  
/opt/local/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:232:in  
`execute' /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:202:in`invoke’  
/opt/local/lib/ruby/1.8/thread.rb:135:in `synchronize' /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:195:in`invoke’  
/opt/local/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:1719:in `run' /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:1719:in`run’  
/opt/local/lib/ruby/gems/1.8/gems/rake-0.7.0/bin/rake:7  
/opt/local/bin/rake:18

Eventually I gave up and ran “rake rails:freeze:edge REVISION=4091”  
which to my knowledge is effectively the same thing.

---

<div class="post-metadata">

**Author:** ![mgreenly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85f322/32.png) [@mgreenly](https://www.ruby-forum.com/u/mgreenly)\
**Post date:** [March 28, 2006, 9:28pm UTC](https://www.ruby-forum.com/t/rails-1-1-and-freeze-gems/89290/3 "2006-03-28T21:28:52Z")

</div>

Thanks for the pointer, Ashley. I’ll give that a try to get by for  
the time being.

Can anyone else out there get “rake freeze\_gems” to work at all on any  
platform for Rails 1.1?

---

<div class="post-metadata">

**Author:** ![mgreenly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85f322/32.png) [@mgreenly](https://www.ruby-forum.com/u/mgreenly)\
**Post date:** [April 2, 2006, 10:54pm UTC](https://www.ruby-forum.com/t/rails-1-1-and-freeze-gems/89290/4 "2006-04-02T22:54:36Z")

</div>

Hi,

I created a new migration with “script/generate migration”, but when I  
try to run it with “rake migrate” it looks like the old migration runs  
again (which generates an error since it tries to create a table that’s  
there).

How does Rails figure out which migration to run? Can I explicitly run a  
specific migration to work around the problem? What might have caused it  
in the first place?

This happened after I upgraded to Rails 1.1 so I am wondering whether  
this could have something to do with it.

Thanks for any help!  
Ingo W.

---

<div class="post-metadata">

**Author:** ![mgreenly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85f322/32.png) [@mgreenly](https://www.ruby-forum.com/u/mgreenly)\
**Post date:** [April 2, 2006, 10:17pm UTC](https://www.ruby-forum.com/t/rails-1-1-and-freeze-gems/89290/5 "2006-04-02T22:17:07Z")

</div>

Check out  
[http://dev.rubyonrails.org/ticket/4458](http://dev.rubyonrails.org/ticket/4458)

This fixed it for me.

Michael G. wrote:

> Thanks for the pointer, Ashley. I’ll give that a try to get by for  
> the time being.
> 
> Can anyone else out there get “rake freeze\_gems” to work at all on any  
> platform for Rails 1.1?

---

<div class="post-metadata">

**Author:** ![mgreenly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85f322/32.png) [@mgreenly](https://www.ruby-forum.com/u/mgreenly)\
**Post date:** [April 2, 2006, 11:40pm UTC](https://www.ruby-forum.com/t/rails-1-1-and-freeze-gems/89290/6 "2006-04-02T23:40:16Z")

</div>

On Sun, 2006-04-02 at 22:51 +0200, Ingo W. wrote:

> Hi,
> 
> I created a new migration with “script/generate migration”, but when I  
> try to run it with “rake migrate” it looks like the old migration runs  
> again (which generates an error since it tries to create a table that’s  
> there).
> 
> How does Rails figure out which migration to run?

* * *

## The ‘version’ column of the ‘schema\_info’ table in your appropriate db

> Can I explicitly run a  
> specific migration to work around the problem?

* * *

## I suppose if you manually change the ‘version’ of the ‘schema info’ - never tried it myself

> What might have caused it  
> in the first place?

* * *

- never successfully migrated that db
- restored db from a dump that didn’t have ‘schema\_info’ table
- deleted schema\_info table  
probably others

* * *

> This happened after I upgraded to Rails 1.1 so I am wondering whether  
> this could have something to do with it.

* * *

perhaps, perhaps not.

did you do ‘rake rails:update’ to your rails app after you upgraded  
rails?

Craig

---

<div class="post-metadata">

**Author:** ![mgreenly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85f322/32.png) [@mgreenly](https://www.ruby-forum.com/u/mgreenly)\
**Post date:** [April 2, 2006, 11:49pm UTC](https://www.ruby-forum.com/t/rails-1-1-and-freeze-gems/89290/7 "2006-04-02T23:49:26Z")

</div>

You can do “rake migrate VERSION=4”… but that doesn’t necessarily  
fix the problem, because if it thinks its currently on a different  
version to what it is, it still won’t work.

The problem could have been caused by an error in your migration code.  
When you run it and it’s interrupted midway through, it’ll stop  
between versions, so even if you subsequently fix the code, it’ll  
still cause an error. In my experience, Rails 1.1 is better at  
detecting errors in the migration code before it actually runs it, but  
it’s still not perfect. If your code is stuck between versions, there  
are two ways you can fix it:

1. Delete everything and then run rake migrate again. This is fine if  
you’re in development and don’t have lots of data in the tables (other  
than data created by migration), but if you do have data, this can be  
a problem.

2. Find out what version the code is breaking at (rake migrate  
–trace) then manually do what you need to in the database to complete  
the migrate or roll back to the previous version.

Hope this helps.  
-Nathan

---

<div class="post-metadata">

**Author:** ![mgreenly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85f322/32.png) [@mgreenly](https://www.ruby-forum.com/u/mgreenly)\
**Post date:** [April 4, 2006, 12:44am UTC](https://www.ruby-forum.com/t/rails-1-1-and-freeze-gems/89290/8 "2006-04-04T00:44:47Z")

</div>

You don’t give a copy of the error, but I’ll throw you a hint:  
0XX\_create\_foo.rb and 0YY\_create\_foo.rb both define a class  
CreateFoo. Migrations go strange when this happens. Rename the  
newer one and change the defined class name to match.

(If that’s your problem, of course 😉

-Rob

Rob B. [http://agileconsultingllc.com](http://agileconsultingllc.com)  
removed\_email\_address@domain.invalid  
+1 513-295-4739
