clearance: Not working with a Rails 5 api

Hi,

I have a Rails 5 api and I try use Clearance in it but have this error : No such middleware to insert after: ActionDispatch::ParamsParser (RuntimeError). Here is a middleware in dev :

use Rack::Sendfile
use ActionDispatch::Static
use ActionDispatch::LoadInterlock
use ActiveSupport::Cache::Strategy::LocalCache::Middleware
use Rack::Runtime
use ActionDispatch::RequestId
use Rails::Rack::Logger
use ActionDispatch::ShowExceptions
use ActionDispatch::DebugExceptions
use ActionDispatch::RemoteIp
use ActionDispatch::Reloader
use ActionDispatch::Callbacks
use ActiveRecord::Migration::CheckPending
use ActiveRecord::ConnectionAdapters::ConnectionManagement
use ActiveRecord::QueryCache
use Rack::Head
use Rack::ConditionalGet
use Rack::ETag
use Rack::Cors
use ActionView::Digestor::PerRequestDigestCacheExpiry
run Tiny::Application.routes

And for production :

use Rack::Sendfile
use ActionDispatch::LoadInterlock
use ActiveSupport::Cache::Strategy::LocalCache::Middleware
use Rack::Runtime
use ActionDispatch::RequestId
use Rails::Rack::Logger
use ActionDispatch::ShowExceptions
use ActionDispatch::DebugExceptions
use ActionDispatch::RemoteIp
use ActionDispatch::Callbacks
use ActiveRecord::ConnectionAdapters::ConnectionManagement
use ActiveRecord::QueryCache
use Rack::Head
use Rack::ConditionalGet
use Rack::ETag
use Rack::Cors
run Tiny::Application.routes

What’s the best place for the middleware? Why not to simply put it at the end?

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 20 (14 by maintainers)

Most upvoted comments

I am having the same issue with Rails 5 beta 2 and Clearance 1.12.1

/Users/drale2k/.rvm/gems/ruby-2.2.4/gems/actionpack-5.0.0.beta2/lib/action_dispatch/middleware/stack.rb:108:in "assert_index": No such middleware to insert after: ActionDispatch::ParamsParser