Running rake seed:migrate fails in production
zaccari opened this issue · comments
We are experiencing a weird issue where running RAILS_ENV=production rake seed:migrate
fails with the following error:
LoadError: no such file to load -- data_migration
/app/vendor/bundle/jruby/1.9/gems/activesupport-3.2.19/lib/active_support/dependencies.rb:251:in 'require'
/app/vendor/bundle/jruby/1.9/gems/activesupport-3.2.19/lib/active_support/dependencies.rb:236:in 'load_dependency'
/app/vendor/bundle/jruby/1.9/gems/activesupport-3.2.19/lib/active_support/dependencies.rb:251:in 'require'
/app/vendor/bundle/jruby/1.9/gems/seed_migration-1.0.2/lib/seed_migration/migrator.rb:2:in '(root)'
/app/vendor/bundle/jruby/1.9/gems/seed_migration-1.0.2/lib/tasks/seed_migration_tasks.rake:1:in '(root)'
/app/vendor/bundle/jruby/1.9/gems/seed_migration-1.0.2/lib/tasks/seed_migration_tasks.rake:4:in '(root)'
Tasks: TOP => seed:migrate
(See full trace by running task with --trace)
We have tried requiring the data_migration
model in various places, but to no avail. Are you able to successfully migrate seeds in production with the latest release?
Hi,
We use the latest release without any problem. At first glance, I'd say the issue might be because you're using jruby, as we never tested it with it.
I'll try to look into this issue if I get some time during the week.
Thank you for the quick reply. We were hoping it was just a JRuby
issue as well, but we're able to reproduce on MRI 2.1:
$ RAILS_ENV=production rake seed:migrate [ruby-2.1.2]
rake aborted!
NameError: uninitialized constant SeedMigration::DataMigration
/Users/michael/.rvm/gems/ruby-2.1.2/gems/seed_migration-1.0.2/lib/seed_migration/migrator.rb:176:in `get_last_migration_date'
/Users/michael/.rvm/gems/ruby-2.1.2/gems/seed_migration-1.0.2/lib/seed_migration/migrator.rb:137:in `get_new_migrations'
/Users/michael/.rvm/gems/ruby-2.1.2/gems/seed_migration-1.0.2/lib/seed_migration/migrator.rb:67:in `run_new_migrations'
/Users/michael/.rvm/gems/ruby-2.1.2/gems/seed_migration-1.0.2/lib/seed_migration/migrator.rb:76:in `run_migrations'
/Users/michael/.rvm/gems/ruby-2.1.2/gems/seed_migration-1.0.2/lib/tasks/seed_migration_tasks.rake:4:in `block (2 levels) in <top (required)>'
/Users/michael/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `eval'
/Users/michael/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => seed:migrate
(See full trace by running task with --trace)
Thanks for the details, that is weird as we test it on MRI 2.1 on travis. I'll let you know if I find more details about this issue.
Thanks!
Commented in #13 about this issue.