I'm stumped. rails test and rails console suddenly stopped working for my project and I can't find any recent changes I've made to cause the problem. Running either throws this error:

/var/lib/gems/2.3.0/gems/actionpack-5.1.7/lib/action_dispatch/http/response.rb:89:in `<class:Response>': undefined method `cache_control' for class `ActionDispatch::Response' (NameError)
    from /var/lib/gems/2.3.0/gems/actionpack-5.1.7/lib/action_dispatch/http/response.rb:35:in `<module:ActionDispatch>'
    from /var/lib/gems/2.3.0/gems/actionpack-5.1.7/lib/action_dispatch/http/response.rb:6:in `<top (required)>'
    from /var/lib/gems/2.3.0/gems/actionpack-5.1.7/lib/action_controller/metal/live.rb:1:in `require'
    from /var/lib/gems/2.3.0/gems/actionpack-5.1.7/lib/action_controller/metal/live.rb:1:in `<top (required)>'
    from /var/lib/gems/2.3.0/gems/actionpack-5.1.7/lib/action_controller.rb:4:in `require'
    from /var/lib/gems/2.3.0/gems/actionpack-5.1.7/lib/action_controller.rb:4:in `<top (required)>'
    from /var/lib/gems/2.3.0/gems/actionpack-5.1.7/lib/action_controller/railtie.rb:2:in `require'
    from /var/lib/gems/2.3.0/gems/actionpack-5.1.7/lib/action_controller/railtie.rb:2:in `<top (required)>'
    from /var/lib/gems/2.3.0/gems/activerecord-5.1.7/lib/active_record/railtie.rb:9:in `require'
    from /var/lib/gems/2.3.0/gems/activerecord-5.1.7/lib/active_record/railtie.rb:9:in `<top (required)>'
    from /var/lib/gems/2.3.0/gems/railties-5.1.7/lib/rails/all.rb:14:in `require'
    from /var/lib/gems/2.3.0/gems/railties-5.1.7/lib/rails/all.rb:14:in `block in <top (required)>'
    from /var/lib/gems/2.3.0/gems/railties-5.1.7/lib/rails/all.rb:12:in `each'
    from /var/lib/gems/2.3.0/gems/railties-5.1.7/lib/rails/all.rb:12:in `<top (required)>'
    from /home/jeff/src/rails/sfpix/config/application.rb:3:in `require'
    from /home/jeff/src/rails/sfpix/config/application.rb:3:in `<top (required)>'
    from /var/lib/gems/2.3.0/gems/spring-2.0.2/lib/spring/application.rb:92:in `require'
    from /var/lib/gems/2.3.0/gems/spring-2.0.2/lib/spring/application.rb:92:in `preload'
    from /var/lib/gems/2.3.0/gems/spring-2.0.2/lib/spring/application.rb:153:in `serve'
    from /var/lib/gems/2.3.0/gems/spring-2.0.2/lib/spring/application.rb:141:in `block in run'
    from /var/lib/gems/2.3.0/gems/spring-2.0.2/lib/spring/application.rb:135:in `loop'
    from /var/lib/gems/2.3.0/gems/spring-2.0.2/lib/spring/application.rb:135:in `run'
    from /var/lib/gems/2.3.0/gems/spring-2.0.2/lib/spring/application/boot.rb:19:in `<top (required)>'
    from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from -e:1:in `<main>'

Googling hasn't produced any helpful suggestions. I've tried checking out earlier working commits and running bundle install to downgrade gems using their Gemfile.lock files, but I still get the same error message.

If I chdir into other Rails projects, rails test and rails console work fine.

Does anyone have any ideas of where to start looking?

Thanks very much,
Jeff

1 Answers

0
Jeff Covey On

Someone on Github suggested I upgrade to at least Rack 2.0. That immediately fixed my problem.