当我试图抛出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
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句