Rails Edge migration error

24 views
Skip to first unread message

Michael Irwin

unread,
Apr 14, 2008, 11:12:43 PM4/14/08
to Comatose Plugin
I've been trying to debug an issue with getting comatose (from github)
installed and working using Rails Edge (as of today). When running
the default migration, I get:

** Invoke db:migrate:reset (first_time)
** Invoke db:drop (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:drop
** Invoke db:create (first_time)
** Invoke environment
** Execute db:create
db/development.sqlite3 already exists
** Invoke db:migrate (first_time)
** Invoke environment
** Execute db:migrate
== 1 CreateUsers: migrating
===================================================
-- create_table(:users, {:force=>true})
-> 0.0045s
-- add_index(:users, :email, {:unique=>true})
-> 0.0033s
== 1 CreateUsers: migrated (0.0082s)
==========================================

== 20080414103651 AddComatoseSupport: migrating
===============================
-- create_table(:comatose_pages, {:force=>true})
-> 0.0052s
Creating the default 'Home Page'...
rake aborted!
can't convert String into Integer
/Users/mdi/Code/avlvibe/vendor/rails/activerecord/lib/active_record/
dirty.rb:127:in `[]='
/Users/mdi/Code/avlvibe/vendor/rails/activerecord/lib/active_record/
dirty.rb:127:in `write_attribute'
/Users/mdi/Code/avlvibe/vendor/rails/activerecord/lib/active_record/
attribute_methods.rb:200:in `author='
/Users/mdi/Code/avlvibe/vendor/rails/activerecord/lib/active_record/
base.rb:2313:in `send'
/Users/mdi/Code/avlvibe/vendor/rails/activerecord/lib/active_record/
base.rb:2313:in `attributes='
/Users/mdi/Code/avlvibe/vendor/rails/activerecord/lib/active_record/
base.rb:2312:in `each'
/Users/mdi/Code/avlvibe/vendor/rails/activerecord/lib/active_record/
base.rb:2312:in `attributes='
/Users/mdi/Code/avlvibe/vendor/rails/activerecord/lib/active_record/
base.rb:2097:in `initialize'
/Users/mdi/Code/avlvibe/vendor/rails/activerecord/lib/active_record/
base.rb:604:in `new'
/Users/mdi/Code/avlvibe/vendor/rails/activerecord/lib/active_record/
base.rb:604:in `create'
./db/migrate//20080414103651_add_comatose_support.rb:28:in
`up_without_benchmarks'
/Users/mdi/Code/avlvibe/vendor/rails/activerecord/lib/active_record/
migration.rb:258:in `send'
/Users/mdi/Code/avlvibe/vendor/rails/activerecord/lib/active_record/
migration.rb:258:in `migrate'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
1.8/benchmark.rb:293:in `measure'
/Users/mdi/Code/avlvibe/vendor/rails/activerecord/lib/active_record/
migration.rb:258:in `migrate'
/Users/mdi/Code/avlvibe/vendor/rails/activerecord/lib/active_record/
migration.rb:422:in `migrate'
/Users/mdi/Code/avlvibe/vendor/rails/activerecord/lib/active_record/
migration.rb:412:in `each'
/Users/mdi/Code/avlvibe/vendor/rails/activerecord/lib/active_record/
migration.rb:412:in `migrate'
/Users/mdi/Code/avlvibe/vendor/rails/activerecord/lib/active_record/
migration.rb:351:in `up'
/Users/mdi/Code/avlvibe/vendor/rails/activerecord/lib/active_record/
migration.rb:334:in `migrate'
/Users/mdi/Code/avlvibe/vendor/rails/railties/lib/tasks/databases.rake:
99
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:546:in `call'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:546:in `execute'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in `execute'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:508:in
`invoke_with_call_chain'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in
`synchronize'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in
`invoke_with_call_chain'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:518:in
`invoke_prerequisites'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1183:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1183:in `send'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1183:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:515:in
`invoke_prerequisites'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:507:in
`invoke_with_call_chain'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in
`synchronize'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in
`invoke_with_call_chain'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:494:in `invoke'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1931:in
`invoke_task'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in `top_level'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in `top_level'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1948:in
`standard_exception_handling'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1903:in `top_level'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1881:in `run'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1948:in
`standard_exception_handling'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1878:in `run'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/bin/rake:31
/usr/bin/rake:19:in `load'
/usr/bin/rake:19

I haven't been able to figure out what the issue is yet. Anyone have
any ideas?

Michael Irwin

unread,
Apr 14, 2008, 11:39:41 PM4/14/08
to Comatose Plugin
After further research, it looks like it may be a Rails issue. On
line 127 of dirty.rb (as noted below), "changed_attributes" is an
array but looks like it should be a hash. Can anyone else verify
this?

Michael Irwin

unread,
Apr 16, 2008, 8:47:33 AM4/16/08
to Comatose Plugin
I finally figured this out. If anyone else runs into this issue,
here's the fix:

* In the comatose directory, rename/remove acts_as_versioned.rb
* Install acts_as_versioned from http://github.com/codafoo/acts_as_versioned/tree/master
* Apply http://pastie.textmate.org/181667 to vendor/rails/activerecord/
lib/active_record/associations.rb

That should allow the comatose migration to run.

Thibaut Barrère

unread,
Apr 30, 2008, 3:32:43 AM4/30/08
to Comatose Plugin
Hi Michael,

thanks for sharing the answer!

cheers

-- Thibaut

Bill Burcham

unread,
Jun 17, 2008, 5:42:27 PM6/17/08
to Comatose Plugin
Michael—is that assocaition.rb tweak general-purpose enough to submit
as a Rails patch? I did a little searching and found no corresponding
bug report in Rails Lighthouse: http://rails.lighthouseapp.com/dashboard

Michael Irwin

unread,
Jun 22, 2008, 10:40:25 PM6/22/08
to Comatose Plugin
I believe this patch is no longer necessary if you're using the code
found at http://github.com/darthapo/comatose/tree/master.

gobigdave

unread,
Jul 23, 2008, 10:21:49 PM7/23/08
to Comatose Plugin
I'm using the latest code from http://github.com/darthapo/comatose/tree/master,
and I am still forced to apply the pastie. I'd like to think there
would be a way to make this work without modifying Rails.

Note, it's not just the Comatose migration that doesn't run. NO
migrations will run.

On Jun 22, 10:40 pm, Michael Irwin <m...@manicdev.com> wrote:
> I believe this patch is no longer necessary if you're using the code
> found athttp://github.com/darthapo/comatose/tree/master.

MRoderick

unread,
Jul 25, 2008, 8:52:01 AM7/25/08
to Comatose Plugin
On Jul 24, 4:21 am, gobigdave <gobigd...@gmail.com> wrote:
> I'm using the latest code fromhttp://github.com/darthapo/comatose/tree/master,
> and I am still forced to apply the pastie.  I'd like to think there
> would be a way to make this work without modifying Rails.
>
> Note, it's not just the Comatose migration that doesn't run.  NO
> migrations will run.

This is really odd... when upgrading a project from 2.0.2 to 2.1, I am
seeing the exact same behaviour.

After patching associations.rb, it will run migrations again.

I did remove 0.7 version of comatose via "script/plugin remove" and
added the http://github.com/darthapo/comatose/tree/master version via
git clone, without running the generators.

Just the other day, I added comatose to a fresh 2.1 one application,
and there were no problems running migrations, so I suspect that the
problem is with something in the host application, and not so much in
the plugin. This could be old rails files or old comatose files.

Bill Burcham

unread,
Sep 17, 2008, 3:19:44 PM9/17/08
to Comatose Plugin
I entered a ticket on June 20, 2008 here:
http://code.google.com/p/comatose-plugin/issues/detail?id=38

Ron Evans

unread,
Nov 4, 2008, 2:22:09 PM11/4/08
to Comatose Plugin
I think I have a solution for this that involves no patching of rails
or other nasty things:
http://deadprogrammersociety.com/2008/11/i-think-im-comatose.html

Regards,
Ron Evans
Reply all
Reply to author
Forward
0 new messages