Read more

How to fix: "500 Internal Server Error" after adding Rack::Bug

Arne Hartherz
December 05, 2011Software engineer at makandra GmbH

When Rack::Bug has been added to your project and your Apache2/Passenger only replies with an Error 500 (Internal Server Error) you won't get any love from both application and Apache logs.

Illustration online protection

Rails Long Term Support

Rails LTS provides security patches for old versions of Ruby on Rails (2.3, 3.2, 4.2 and 5.2)

  • Prevents you from data breaches and liability risks
  • Upgrade at your own pace
  • Works with modern Rubies
Read more Show archive.org snapshot

You can start a script/server and try connecting there. It should also fail but you will most likely see this error:

Internal Server Error  
undefined method `new' for "Rack::Bug":String

While the following is (for some reason) working on OSX...

config.middleware.use "Rack::Bug", :secret_key => '...'

...you need to do this so it works properly on Linux:

require 'rack/bug'
config.middleware.use "Rack::Bug", :secret_key => '...'
Posted by Arne Hartherz to makandra dev (2011-12-05 16:27)