我正在尝试在数字海洋平台上部署我的应用程序。 问题可能出在设计上。 我正在使用postgres数据库。

我试过跑步

RAILS_ENV = production2佣金db:create

但它给我错误:

rake aborted!
NoMethodError: undefined method `app_id' for nil:NilClass
/home/Clot-/config/initializers/devise.rb:252:in `block in <top (required)>'
/usr/local/rvm/gems/ruby-2.1.5/gems/devise-3.2.4/lib/devise.rb:288:in `setup'
/home/Clot-/config/initializers/devise.rb:3:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.1.5/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:223:in `load'
/usr/local/rvm/gems/ruby-2.1.5/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:223:in `block in load'
/usr/local/rvm/gems/ruby-2.1.5/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:214:in `load_dependency'
/usr/local/rvm/gems/ruby-2.1.5/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:223:in `load'
/usr/local/rvm/gems/ruby-2.1.5/gems/railties-4.0.2/lib/rails/engine.rb:609:in `block (2 levels) in <class:Engine>'
/usr/local/rvm/gems/ruby-2.1.5/gems/railties-4.0.2/lib/rails/engine.rb:608:in `each'
/usr/local/rvm/gems/ruby-2.1.5/gems/railties-4.0.2/lib/rails/engine.rb:608:in `block in <class:Engine>'
/usr/local/rvm/gems/ruby-2.1.5/gems/railties-4.0.2/lib/rails/initializable.rb:30:in `instance_exec'
/usr/local/rvm/gems/ruby-2.1.5/gems/railties-4.0.2/lib/rails/initializable.rb:30:in `run'
/usr/local/rvm/gems/ruby-2.1.5/gems/railties-4.0.2/lib/rails/initializable.rb:55:in `block in run_initializers'
/usr/local/rvm/gems/ruby-2.1.5/gems/railties-4.0.2/lib/rails/initializable.rb:44:in `each'
/usr/local/rvm/gems/ruby-2.1.5/gems/railties-4.0.2/lib/rails/initializable.rb:44:in `tsort_each_child'
/usr/local/rvm/gems/ruby-2.1.5/gems/railties-4.0.2/lib/rails/initializable.rb:54:in `run_initializers'
/usr/local/rvm/gems/ruby-2.1.5/gems/railties-4.0.2/lib/rails/application.rb:215:in `initialize!'
/home/Clot-/config/environment.rb:5:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.1.5/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `require'
/usr/local/rvm/gems/ruby-2.1.5/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `block in require'
/usr/local/rvm/gems/ruby-2.1.5/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:214:in `load_dependency'
/usr/local/rvm/gems/ruby-2.1.5/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `require'
/usr/local/rvm/gems/ruby-2.1.5/gems/railties-4.0.2/lib/rails/application.rb:189:in `require_environment!'
/usr/local/rvm/gems/ruby-2.1.5/gems/railties-4.0.2/lib/rails/application.rb:250:in `block in run_tasks_blocks'
/usr/local/rvm/gems/ruby-2.1.5/bin/ruby_executable_hooks:15:in `eval'
/usr/local/rvm/gems/ruby-2.1.5/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)

===============>>#1 票数:0

您是否可能错过了在devise用户模型上添加字段app_id?

===============>>#2 票数:0

这看起来不像是迁移特定的错误。 它看起来像一个nil错误。 似乎您正在尝试访问nil字段“ app_id”。 尝试查看初始化文件中可能发生这种情况的地方,尤其是

/home/Clot-/config/initializers/devise.rb:252:in

  ask by Adt translate from so

未解决问题?本站智能推荐: