ruby – Rails 5升级:之后没有插入这样的中间件:ActionDispatch :: ParamsParser(RuntimeError)

前端之家收集整理的这篇文章主要介绍了ruby – Rails 5升级:之后没有插入这样的中间件:ActionDispatch :: ParamsParser(RuntimeError)前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在开发中将应用程序从Rails 4.2升级到Rails 5 beta1.1.应用程序升级前运行良好.我已经完成了基本的升级步骤(更新 Ruby,更新Rails以及相关步骤: http://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html). Gemfile也已更新到最新的Gems.

当我运行$rails中间件或$rails控制台或$rails服务器时,我收到以下错误

No such middleware to insert after: ActionDispatch::ParamsParser
.../.rvm/gems/ruby-2.3.0/bundler/gems/rails-dbf67b3a6f54/actionpack/lib/action_dispatch/middleware/stack.rb:108:in `assert_index'
.../.rvm/gems/ruby-2.3.0/bundler/gems/rails-dbf67b3a6f54/actionpack/lib/action_dispatch/middleware/stack.rb:80:in `insert_after'
.../.rvm/gems/ruby-2.3.0/bundler/gems/rails-dbf67b3a6f54/railties/lib/rails/configuration.rb:69:in `block in merge_into'
.../.rvm/gems/ruby-2.3.0/bundler/gems/rails-dbf67b3a6f54/railties/lib/rails/configuration.rb:68:in `each'
.../.rvm/gems/ruby-2.3.0/bundler/gems/rails-dbf67b3a6f54/railties/lib/rails/configuration.rb:68:in `merge_into'
.../.rvm/gems/ruby-2.3.0/bundler/gems/rails-dbf67b3a6f54/railties/lib/rails/engine.rb:507:in `block in app'
.../.rvm/gems/ruby-2.3.0/bundler/gems/rails-dbf67b3a6f54/railties/lib/rails/engine.rb:504:in `synchronize'
.../.rvm/gems/ruby-2.3.0/bundler/gems/rails-dbf67b3a6f54/railties/lib/rails/engine.rb:504:in `app'
.../.rvm/gems/ruby-2.3.0/bundler/gems/rails-dbf67b3a6f54/railties/lib/rails/application/finisher.rb:34:in `block in <module:Finisher>'
.../.rvm/gems/ruby-2.3.0/bundler/gems/rails-dbf67b3a6f54/railties/lib/rails/initializable.rb:30:in `instance_exec'
.../.rvm/gems/ruby-2.3.0/bundler/gems/rails-dbf67b3a6f54/railties/lib/rails/initializable.rb:30:in `run'
.../.rvm/gems/ruby-2.3.0/bundler/gems/rails-dbf67b3a6f54/railties/lib/rails/initializable.rb:55:in `block in run_initializers'
.../.rvm/gems/ruby-2.3.0/bundler/gems/rails-dbf67b3a6f54/railties/lib/rails/initializable.rb:54:in `run_initializers'
.../.rvm/gems/ruby-2.3.0/bundler/gems/rails-dbf67b3a6f54/railties/lib/rails/application.rb:350:in `initialize!'
.../config/environment.rb:5:in `<top (required)>'
.../.rvm/gems/ruby-2.3.0/bundler/gems/rails-dbf67b3a6f54/activesupport/lib/active_support/dependencies.rb:302:in `require'
.../.rvm/gems/ruby-2.3.0/bundler/gems/rails-dbf67b3a6f54/activesupport/lib/active_support/dependencies.rb:302:in `block in require'
.../.rvm/gems/ruby-2.3.0/bundler/gems/rails-dbf67b3a6f54/activesupport/lib/active_support/dependencies.rb:268:in `load_dependency'
.../.rvm/gems/ruby-2.3.0/bundler/gems/rails-dbf67b3a6f54/activesupport/lib/active_support/dependencies.rb:302:in `require'
.../.rvm/gems/ruby-2.3.0/bundler/gems/rails-dbf67b3a6f54/railties/lib/rails/application.rb:326:in `require_environment!'
.../.rvm/gems/ruby-2.3.0/bundler/gems/rails-dbf67b3a6f54/railties/lib/rails/application.rb:446:in `block in run_tasks_blocks'
.../.rvm/gems/ruby-2.3.0/bundler/gems/rails-dbf67b3a6f54/railties/lib/rails/commands/rake_proxy.rb:13:in `block in run_rake_task'
.../.rvm/gems/ruby-2.3.0/bundler/gems/rails-dbf67b3a6f54/railties/lib/rails/commands/rake_proxy.rb:10:in `run_rake_task'
.../.rvm/gems/ruby-2.3.0/bundler/gems/rails-dbf67b3a6f54/railties/lib/rails/commands/commands_tasks.rb:51:in `run_command!'
.../.rvm/gems/ruby-2.3.0/bundler/gems/rails-dbf67b3a6f54/railties/lib/rails/command.rb:20:in `run'
.../.rvm/gems/ruby-2.3.0/bundler/gems/rails-dbf67b3a6f54/railties/lib/rails/commands.rb:19:in `<top (required)>'
bin/rails:4:in `require'
bin/rails:4:in `<main>'

这与ActionDispatch :: ParamsParser已从Rails 5 beta中间件(https://github.com/rails/rails/commit/38d2bf5fd1f3e014f2397898d371c339baa627b1)中删除的事实有关.但是,在某种程度上我的应用程序似乎仍然在寻找它.

我在config / application.rb中尝试过各种各样的ActionDispatch :: ParamsParser,比如删除它,当它不起作用时,我也尝试添加它.同样的错误.有没有办法克服这个错误

解决方法

我相信这个错误是由一个尚未更新Rails 5的gem引起的.我一直在使用gem remotipart( https://github.com/JangoSteve/remotipart).这非常有帮助.当我从gem文件删除它时,问题中提到的错误消失了.

猜你在找的Ruby相关文章