2014-08-29 104 views
3
NoMethodError: undefined method `dump_schema_after_migration=' for ActiveRecord: 
:Base:Class 

:遷移

我是新來的Heroku的部署,並沒有能夠解決它,請在解決它 預先感謝幫助。

這就是我實際得到的。

$ heroku run rake db:migrate 

這是完全錯誤跟蹤:

Running `rake db:migrate` attached to terminal... up, run.4727 
rake aborted! 
NoMethodError: undefined method `dump_schema_after_migration=' for ActiveRecord: 
:Base:Class 
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.8/lib/active_record/dynamic_ 
matchers.rb:22:in `method_missing' 
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.8/lib/active_record/railtie. 
rb:166:in `block (3 levels) in <class:Railtie>' 
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.8/lib/active_record/railtie. 
rb:165:in `each' 
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.8/lib/active_record/railtie. 
rb:165:in `block (2 levels) in <class:Railtie>' 
/app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.8/lib/active_support/lazy_l 
oad_hooks.rb:38:in `instance_eval' 
/app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.8/lib/active_support/lazy_l 
oad_hooks.rb:38:in `execute_hook' 
/app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.8/lib/active_support/lazy_l 
oad_hooks.rb:28:in `block in on_load' 
/app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.8/lib/active_support/lazy_l 
oad_hooks.rb:27:in `each' 
/app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.8/lib/active_support/lazy_l 
oad_hooks.rb:27:in `on_load' 
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.8/lib/active_record/railtie. 
rb:114:in `block in <class:Railtie>' 
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.8/lib/rails/initializable.rb:30: 
in `instance_exec' 
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.8/lib/rails/initializable.rb:30: 
in `run' 
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.8/lib/rails/initializable.rb:55: 
in `block in run_initializers' 
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.8/lib/rails/initializable.rb:54: 
in `run_initializers' 
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.8/lib/rails/application.rb:215:i 
n `initialize!' 
/app/config/environment.rb:5:in `<top (required)>' 
/app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.8/lib/active_support/depend 
encies.rb:229:in `require' 
/app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.8/lib/active_support/depend 
encies.rb:229:in `block in require' 
/app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.8/lib/active_support/depend 
encies.rb:214:in `load_dependency' 
/app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.8/lib/active_support/depend 
encies.rb:229:in `require' 
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.8/lib/rails/application.rb:189:i 
n `require_environment!' 
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.8/lib/rails/application.rb:250:i 
n `block in run_tasks_blocks' 
Tasks: TOP => db:migrate => environment 
(See full trace by running task with --trace) 
+0

你確定這是你唯一的錯誤」重新獲得?你能發佈完整的錯誤跟蹤嗎? – Surya 2014-08-29 08:02:27

+0

注意我在問題中添加了它的確切錯誤。 – Mukesh 2014-08-29 08:16:19

+1

在這裏:https://stackoverflow.com/questions/22707102/cannot-run-any-commands-on-my-heroku-app-migrate-console-etc我希望這有助於 – Surya 2014-08-29 08:37:09

回答

2

假設你使用的是賴斯4,只是刪除下面的代碼在你的config/environments/production.rb

config.active_record.dump_schema_after_migration = false 
+0

試過,但它沒有工作 – Mukesh 2014-08-29 08:16:41

+0

你提交了修改後的文件,然後部署? – RAJ 2014-08-29 08:29:47

相關問題