2011-11-07 44 views
2

這裏是運行用於加載生產DB模式耙的誤差(MySQL的45年5月1日):耙錯誤時負荷生產DB模式

$ rake db:schema:load RAILS_ENV=production --trace 
** Invoke db:schema:load (first_time) 
** Invoke environment (first_time) 
** Execute environment 
rake aborted! 
No such middleware to insert before: ActionDispatch::Static 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/actionpack-3.1.0/lib/action_dispatch/middleware/stack.rb:119:in `assert_index' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/actionpack-3.1.0/lib/action_dispatch/middleware/stack.rb:83:in `insert' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/configuration.rb:38:in `block in merge_into' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/configuration.rb:37:in `each' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/configuration.rb:37:in `merge_into' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/engine.rb:445:in `app' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/application/finisher.rb:37:in `block in <module:Finisher>' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/initializable.rb:25:in `instance_exec' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/initializable.rb:25:in `run' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/initializable.rb:50:in `block in run_initializers' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/initializable.rb:49:in `each' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/initializable.rb:49:in `run_initializers' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/application.rb:92:in `initialize!' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/railtie/configurable.rb:30:in `method_missing' 
D:/rails_proj/emclab-failed/config/environment.rb:5:in `<top (required)>' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/application.rb:78:in `require' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/application.rb:78:in `require_environment!' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/application.rb:189:in `block (2 levels) in initialize_tasks' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:205:in `call' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:205:in `block in execute' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:200:in `each' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain' 
c:/Ruby192/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:176:in `block in invoke_prerequisites' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:174:in `each' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:174:in `invoke_prerequisites' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:157:in `block in invoke_with_call_chain' 
c:/Ruby192/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:90:in `block (2 levels) in top_level' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:90:in `each' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:90:in `block in top_level' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:62:in `block in run' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:59:in `run' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2/bin/rake:32:in `<top (required)>' 
c:/Ruby192/bin/rake:19:in `load' 
c:/Ruby192/bin/rake:19:in `<main>' 
Tasks: TOP => db:schema:load => environment 

請忽略以下:計算器需要比該錯誤信息多個字來解釋情況。錯誤信息比任何單詞都好!

有沒有解決問題的建議?謝謝。

回答

0

someone who had a similar problem,您可能需要進入config/application.rb並替換:

config.middleware.insert_after('ActionDispatch::Static', '::API::Throttle') 

這一行:

config.middleware.insert_before('Rack::Lock', '::API::Throttle') 

希望這有助於!

+0

出錯:耙子中止了! 未初始化的常量API – user938363

1

您不必指定另一塊中間件插入中間件堆棧的前端。相反,你可以只指定一個索引號。例如:

config.middleware.insert_before(0, ::API::Throttle)