#12 ✓resolved
Matt Polito

Unable to run rake db:seed

Reported by Matt Polito | August 18th, 2008 @ 01:22 PM

No matter what I do, I keep getting an undefined method 'seed' when I run the rake task. The only think I noticed is that there was a recent change to the rake task and seed-fu.rb, could it possibly have broken it?

the self.seed and self.seed_many methods are outside of the SeedFu module but are not encased under ActiveRecord::Base as they previously were. I tried adding that but it still would not work.

Comments and changes to this ticket

  • Lar Van Der Jagt

    Lar Van Der Jagt August 19th, 2008 @ 03:14 AM

    I just encountered this bug myself. Will report back if I can find a workaround.

  • Lar Van Der Jagt

    Lar Van Der Jagt August 19th, 2008 @ 04:10 AM

    I just opened up ActiveRecord::Base and placed the seed methods inside there. Also had to directly call SeedFu::Seeder.plant. It works but I no longer get the fancy output letting me know which records were created. I didn't test seed_many either.

    I am guessing this has something to do with making this compatible w/gem dependencies?

  • Matt Polito

    Matt Polito August 19th, 2008 @ 10:12 AM

    Thanks guys, I just noticed that github was updated a few minutes ago so I updated the code and tried again. This time it works with no problems!

  • Michael Bleigh

    Michael Bleigh August 19th, 2008 @ 10:14 AM

    • State changed from “new” to “resolved”

    Yes, it's fixed. Sorry, I was merging together a bunch of branches and didn't do a sanity check to see if I had broken the basic functionality!

  • Lar Van Der Jagt

    Lar Van Der Jagt August 19th, 2008 @ 11:00 AM

    Thanks, changes look good. This also seems to make another issue I had with installing as a gem go away as I was able to do that just now.

    However, now rake doesn't seem to be finding the db:seed command while using the gem. Is there something special I have to do to get that picked up?

  • Michael Bleigh

    Michael Bleigh August 19th, 2008 @ 11:02 AM

    Lar: Unfortunately, Rails 2.1 does not properly support the loading of rake tasks from GemPlugins (to my knowledge). I would suggest keeping it as a standard plugin until a newer version of Rails is available that fixes the problem.

  • Matt Polito

    Matt Polito August 19th, 2008 @ 12:09 PM

    Good to know because I removed the plugin and opted for the gem... and then it didn't work again. I'm back to the plugin and all is fine.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

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

An attempt to simplify the usage of seed data in Rails applications through a dead simple API.