0

I was trying to move my spree commerce application from heroku to digital ocean. therefor I've decided to use dokku. Everything went well so far until I've tried to migrate the database. There seem to be a missing migration.. though I don't unterstand: why is it working on my local machine and on two different heroku apps (staging and production) and why is there an error in dokku?

This is the error from the logs of dokku.

ActiveRecord::SchemaMigration Load (1.4ms)  SELECT "schema_migrations".* FROM "schema_migrations"
Migrating to AddTranslationsToStore (20150602075811)
   (0.4ms)  BEGIN
== 20150602075811 AddTranslationsToStore: migrating ===========================
-- table_exists?(:spree_store_translations)
   -> 0.0011s
   (0.7ms)  ROLLBACK
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:

undefined method `create_translation_table!' for #<Class:0x007f17eb26e620>/app/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.2/lib/active_record/dynamic_matchers.rb:26:in `method_missing'
/app/db/migrate/20150602075811_add_translations_to_store.spree_i18n.rb:6:in `up'
/app/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.2/lib/active_record/migration.rb:609:in `exec_migration'
/app/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.2/lib/active_record/migration.rb:590:in `block (2 levels) in migrate'
/app/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.2/lib/active_record/migration.rb:589:in `block in migrate'
/app/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:292:in `with_connection'
/app/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.2/lib/active_record/migration.rb:588:in `migrate'
/app/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.2/lib/active_record/migration.rb:765:in `migrate'
/app/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.2/lib/active_record/migration.rb:995:in `block in execute_migration_in_transaction'
/app/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.2/lib/active_record/migration.rb:1041:in `block in ddl_transaction'
/app/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.2/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `block in transaction'
/app/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.2/lib/active_record/connection_adapters/abstract/transaction.rb:188:in `within_new_transaction'
/app/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.2/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `transaction'
/app/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.2/lib/active_record/transactions.rb:220:in `transaction'
/app/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.2/lib/active_record/migration.rb:1041:in `ddl_transaction'
/app/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.2/lib/active_record/migration.rb:994:in `execute_migration_in_transaction'
/app/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.2/lib/active_record/migration.rb:956:in `block in migrate'
/app/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.2/lib/active_record/migration.rb:952:in `each'
/app/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.2/lib/active_record/migration.rb:952:in `migrate'
/app/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.2/lib/active_record/migration.rb:820:in `up'
/app/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.2/lib/active_record/migration.rb:798:in `migrate'
/app/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.2/lib/active_record/tasks/database_tasks.rb:137:in `migrate'
/app/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.2/lib/active_record/railties/databases.rake:44:in `block (2 levels) in <top (required)>'
NoMethodError: undefined method `create_translation_table!' for #<Class:0x007f17eb26e620>
/app/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.2/lib/active_record/dynamic_matchers.rb:26:in `method_missing'
/app/db/migrate/20150602075811_add_translations_to_store.spree_i18n.rb:6:in `up'
/app/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.2/lib/active_record/migration.rb:609:in `exec_migration'
/app/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.2/lib/active_record/migration.rb:590:in `block (2 levels) in migrate'
/app/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.2/lib/active_record/migration.rb:589:in `block in migrate'
/app/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:292:in `with_connection'
/app/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.2/lib/active_record/migration.rb:588:in `migrate'
/app/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.2/lib/active_record/migration.rb:765:in `migrate'
/app/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.2/lib/active_record/migration.rb:995:in `block in execute_migration_in_transaction'
/app/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.2/lib/active_record/migration.rb:1041:in `block in ddl_transaction'
/app/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.2/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `block in transaction'
/app/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.2/lib/active_record/connection_adapters/abstract/transaction.rb:188:in `within_new_transaction'
/app/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.2/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `transaction'
/app/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.2/lib/active_record/transactions.rb:220:in `transaction'
/app/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.2/lib/active_record/migration.rb:1041:in `ddl_transaction'
/app/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.2/lib/active_record/migration.rb:994:in `execute_migration_in_transaction'
/app/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.2/lib/active_record/migration.rb:956:in `block in migrate'
/app/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.2/lib/active_record/migration.rb:952:in `each'
/app/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.2/lib/active_record/migration.rb:952:in `migrate'
/app/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.2/lib/active_record/migration.rb:820:in `up'
/app/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.2/lib/active_record/migration.rb:798:in `migrate'
/app/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.2/lib/active_record/tasks/database_tasks.rb:137:in `migrate'
/app/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.2/lib/active_record/railties/databases.rake:44:in `block (2 levels) in <top (required)>'
user2030592
  • 317
  • 2
  • 12
  • This error raised from gem [globalize](https://github.com/globalize/globalize) [migration](https://www.omniref.com/github/spree/spree_i18n/HEAD/symbols/Globalize::ActiveRecord::Migration::Migrator/create_translation_table!) Have you completed all installation requirements? – cnnr Sep 18 '15 at 14:10
  • Is the globalize gem listed in your gemspec/Gemfile? – Felix Sep 21 '15 at 07:32
  • GIT remote: git://github.com/spree-contrib/spree_i18n.git revision: a9b909a734cba71187585e95c12dce791541a16f branch: 3-0-stable specs: spree_i18n (3.0.0) friendly_id-globalize globalize (~> 5.0.1) i18n_data (~> 0.7.0) kaminari-i18n (~> 0.3.2) rails-i18n (~> 4.0.1) spree_core (~> 3.0.4) – user2030592 Sep 21 '15 at 10:40

1 Answers1

0

In order to fix this, you need to include the gem spree_globalize, in the past it was part of spree_I18n:

gem 'spree_globalize', github: 'spree-contrib/spree_globalize', branch: 'master'

That will solve the migrations problem

Carlos Castillo
  • 3,218
  • 2
  • 14
  • 10