Rake db:使用错误未定义方法`session_store_host`迁移rails

问题描述 投票:0回答:1

我有几个跨地域的数据库。每个都在我的database.yml文件中有自己的表示。

运行RAILS_ENV=europe rake db:migrate时出现以下错误

undefined method `session_store_host' for #<Rails::Application::Configuration:0x000000038fdda8>

堆:

/usr/local/rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.17/lib/rails/railtie/configuration.rb:85:in `method_missing'
/var/www/vhosts/adm.dyqa.io/html/releases/20190324134144/config/initializers/session_store.rb:9:in `<top (required)>'
/usr/local/rvm/gems/ruby-1.9.3-p327/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:245:in `load'
/usr/local/rvm/gems/ruby-1.9.3-p327/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:245:in `block in load'
/usr/local/rvm/gems/ruby-1.9.3-p327/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:236:in `load_dependency'
/usr/local/rvm/gems/ruby-1.9.3-p327/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:245:in `load'

我的数据库文件:

europe:
  adapter: mysql2
  encoding: utf8
  reconnect: true
  database: production
  pool: 10
  username: USERNAME
  password: PASSWORD
  host: database.mycompany.europe
  port: 1234

danger:
  adapter: mysql2
  encoding: utf8
  reconnect: true
  database: production
  pool: 10
  username: USERNAME
  password: PASSWORD
  host: database.mycompany.usa
  port: 1234
ruby-on-rails database-migration
1个回答
0
投票

结果我错过了配置文件europe.rb创建后,迁移成功运行。

© www.soinside.com 2019 - 2024. All rights reserved.