# Rake db:migrate failing

**URL:** <https://www.ruby-forum.com/t/rake-db-migrate-failing/123962>\
**Category:** Engines Development\
**Created:** [December 22, 2007, 6:51pm UTC](https://www.ruby-forum.com/t/rake-db-migrate-failing/123962 "2007-12-22T18:51:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ben\_wiseley](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/45deac/32.png) [@ben\_wiseley](https://www.ruby-forum.com/u/ben_wiseley)\
**Post date:** [December 22, 2007, 6:51pm UTC](https://www.ruby-forum.com/t/rake-db-migrate-failing/123962/1 "2007-12-22T18:51:09Z")

</div>

I’m running/developing some sites on Rails 2.0.2 and some on 1.2.6. I  
updated to 2.0.2 last night and, while the 1.2.6 sites (using engines)  
still  
seem to run perfectly (after replacing ‘require\_gem’ with ‘gem’ - which  
seems wrong), I’m getting this:

mac-san:~/dev/russell\_store wiseleyb$ rake db:migrate --trace

> /Users/wiseleyb/Dev/russell\_store/config/…/vendor/plugins/engines/tasks/engines.rake:63  
> /Users/wiseleyb/Dev/russell\_store/config/…/vendor/plugins/engines/tasks/engines.rake:58  
> `each' `load\_rakefile’  
> /opt/local/bin/rake:19  
> I did a script/generate plugin\_migration - and that worked fine. But I  
> get  
> the error above when I do rake db:migrate. rake db:migrate works fine  
> on  
> the 2.0.2 sites (that aren’t using engines yet).

Any ideas what would be causing this? I grabbed the latest engines  
version  
from

> script/plugin install [http://svn.rails-engines.org/plugins/engines](http://svn.rails-engines.org/plugins/engines)

I’m running this project on RAILS\_GEM\_VERSION = ‘1.2.6’

Here is the relevant gem list:

> rails (2.0.2, 1.2.6, 1.2.5.7919, 1.2.3, 1.2.1, 1.1.6)  
> rake (0.8.0, 0.7.3, 0.7.1)  
> rubygems-update (1.0.1)  
> actionmailer (2.0.2, 1.3.6, 1.3.5.7919, 1.3.3, 1.3.1, 1.2.5)  
> actionpack (2.0.2, 1.13.6, 1.13.5.7919, 1.13.5, 1.13.3, 1.13.1, 1.12.5)  
> actionwebservice (1.2.6, 1.2.5, 1.2.3, 1.2.1, 1.1.6)  
> activerecord (2.0.2, 1.15.6, 1.15.5.7919, 1.15.5, 1.15.3, 1.15.1, 1.14.4)  
> activeresource (2.0.2, 0.9.0.7919)  
> activesupport (2.0.2, 1.4.4.7919, 1.4.4, 1.4.2, 1.4.0, 1.3.1)

On clue might be that when I first did a “script/server” on this  
project  
after updating it failed on “require\_gem” - which is deprecated in Rails  
2.0.2 but, given RAILS\_GEM\_VERSION = ‘1.2.6’ - shouldn’t that still be  
kosher? It seems like some things are running on Rails 2.0.2 instead of  
the  
version specified.

Sorry for the long email - I’ve kind of hit a wall on this and it seems  
engines related.

-ben

---

<div class="post-metadata">

**Author:** ![ben\_wiseley](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/45deac/32.png) [@ben\_wiseley](https://www.ruby-forum.com/u/ben_wiseley)\
**Post date:** [December 22, 2007, 9:45pm UTC](https://www.ruby-forum.com/t/rake-db-migrate-failing/123962/2 "2007-12-22T21:45:07Z")

</div>

HI Ben,

Looks like this could be a bad interaction between Rake 0.8 and one of  
the hoops that the engines plugin needed to jump through to redefine  
the plugin doc rake task. I’ll see if anything can done - in the  
meantime, just comment out the appropriate task and the  
“redefine\_task” method in the engines plugin’s engines.rake file

James

---

<div class="post-metadata">

**Author:** ![ben\_wiseley](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/45deac/32.png) [@ben\_wiseley](https://www.ruby-forum.com/u/ben_wiseley)\
**Post date:** [December 23, 2007, 4:51pm UTC](https://www.ruby-forum.com/t/rake-db-migrate-failing/123962/3 "2007-12-23T16:51:12Z")

</div>

James,

I updated from [http://svn.rails-engines.org/engines/trunk/](http://svn.rails-engines.org/engines/trunk/) but that  
didn’t  
seem to help.

Got a

mac-san:~/dev/russell\_store wiseleyb$ rake db:migrate --trace

> - 
> 
> /Users/wiseleyb/Dev/russell\_store/vendor/plugins/engines/lib/engines/plugin.rb:15  
> \*  
> /opt/local/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
> `gem_original_require' /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require’

I grabbed this [http://svn.rails-engines.org/plugins/engines/](http://svn.rails-engines.org/plugins/engines/) and renamed  
engines/tasks/engines.rake to engines.rake.old and migrations ran.

Thanks for trying though! Let me know if you want me to try anything  
locally to help debug this.

-ben

---

<div class="post-metadata">

**Author:** ![ben\_wiseley](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/45deac/32.png) [@ben\_wiseley](https://www.ruby-forum.com/u/ben_wiseley)\
**Post date:** [December 22, 2007, 11:31pm UTC](https://www.ruby-forum.com/t/rake-db-migrate-failing/123962/4 "2007-12-22T23:31:05Z")

</div>

I’ve committed a fix to trunk - let us know how that fares.

James

---

<div class="post-metadata">

**Author:** ![ben\_wiseley](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/45deac/32.png) [@ben\_wiseley](https://www.ruby-forum.com/u/ben_wiseley)\
**Post date:** [December 23, 2007, 5:04pm UTC](https://www.ruby-forum.com/t/rake-db-migrate-failing/123962/5 "2007-12-23T17:04:44Z")

</div>

Hi Ben,

Am 23.12.2007 um 16:50 schrieb ben wiseley:

> uninitialized constant Rails::Plugin

The Rails::Plugin class is part of Rails 2.0.x. So this seems to  
indicate that Rails 1.2.6 gets loaded.

> > I’m running this project on RAILS\_GEM\_VERSION = ‘1.2.6’

Have you tried to change this to 2.0?

–  
sven fuchs [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
artweb design [http://www.artweb-design.de](http://www.artweb-design.de)  
grünberger 65 + 49 (0) 30 - 47 98 69 96 (phone)  
d-10245 berlin + 49 (0) 171 - 35 20 38 4 (mobile)

---

<div class="post-metadata">

**Author:** ![ben\_wiseley](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/45deac/32.png) [@ben\_wiseley](https://www.ruby-forum.com/u/ben_wiseley)\
**Post date:** [December 23, 2007, 5:10pm UTC](https://www.ruby-forum.com/t/rake-db-migrate-failing/123962/6 "2007-12-23T17:10:02Z")

</div>

No - because this is a 1.2.6 project - it’s not even close to ready for  
2.0  
I thought I made that clear before but, since it’s trunk, I should have  
known it was the 2’ish code… duh, stupid me (it’s been a long month)  
🙂  
I was having problems running 1.2.6 projects after I updated to Rails  
2.0and Gems  
1.0 - that was the original question. 1.2.6 projects (with engines)  
still  
ran, my 2.0 projects ran, rake db:migrate just failed on 1.2.6 projects.

-ben
