Categories
BLOG

seedbank gem

Rails Seedbank gem uninitialized constant

I am using seedbank gem and getting uninitialized constant on the first line of my seed file User.create(. )

I can run rake db:seed fine without seedbank.

I am using mongoid.

With seedbank I get.

1 Answer 1

An uninitialized constant could be caused because your database isn’t set up with a User model.

https://github.com/james2m/seedbank shows how to reset and setup the database with seedbank:

This will also seed the database so if the command runs successfully, you are in the clear! The reset command is extended by seedbank but also exists in ActiveRecord by default.

CAUTION: Running the db:reset command will delete all database content so use it with care.

Rails Seedbank gem uninitialized constant I am using seedbank gem and getting uninitialized constant on the first line of my seed file User.create(. ) I can run rake db:seed fine without