簡體   English   中英

Heroku在db:migrate rake上引發錯誤

[英]Heroku throws error on db:migrate rake

當我試圖拋出heroku run rake db:migrate正如邁克爾·哈特爾(Michael Hartl)在RoR教程中所說的那樣,它拋出了以下內容:

Running rake db:migrate on shielded-reaches-4728... up, run.2183
rake aborted!
NoMethodError: undefined method 'configure' for #<SampleApp::Application:0x007efe8ced6138>
/app/config/environments/production.rb:1:in '<top (required)>'
/app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in 'require'
/app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in 'block in require'
/app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:214:in 'load_dependency'
/app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in 'require'
..
Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)

我能做什么?

更新:這是我的production.rb文件:

Rails.application.configure do

  config.cache_classes = true

  config.eager_load = true

  config.consider_all_requests_local       = false
  config.action_controller.perform_caching = true

  config.serve_static_assets = false

  config.assets.js_compressor = :uglifier

  config.assets.compile = false

  config.assets.digest = true

  config.log_level = :info

  config.i18n.fallbacks = true

  config.active_support.deprecation = :notify

  config.log_formatter = ::Logger::Formatter.new
  config.active_record.dump_schema_after_migration = false
end

看來您有這樣的事情

...

module SampleApp
  class Application < Rails::Application

...

在您的application.rb文件中。 在這種情況下,您需要在production.rb文件中進行更改

Rails.application.configure

SampleApp::Application.configure

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM