BetterErrors / better_errors

Better error page for Rack apps
MIT License
6.88k stars 435 forks source link

Version 2.8.2 breakage #482

Closed thomasbalsloev closed 3 years ago

thomasbalsloev commented 3 years ago

Hi.

After updating the Better Errors gem to the latest version I get exceptions while loading our Rails app. We use Rails 6.0.3.3 with ruby 2.6.6 and Puma 5.0.2. The Puma workers are not loading caused by this exeception:

/usr/local/rvm/rubies/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/better_errors-2.8.2/lib/better_errors/middleware.rb:43:in': uninitialized constant BetterErrors::Middleware::VERSION (NameError) from /usr/local/rvm/rubies/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/better_errors-2.8.2/lib/better_errors/middleware.rb:28:in <module:BetterErrors>' from /usr/local/rvm/rubies/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/better_errors-2.8.2/lib/better_errors/middleware.rb:7:in<top (required)>' from /usr/local/rvm/rubies/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/better_errors-2.8.2/lib/better_errors.rb:9:in <top (required)>' from /usr/local/rvm/rubies/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:74:inrequire' from /usr/local/rvm/rubies/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:74:in block (2 levels) in require' from /usr/local/rvm/rubies/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:69:ineach' from /usr/local/rvm/rubies/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:69:in block in require' from /usr/local/rvm/rubies/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:58:ineach' from /usr/local/rvm/rubies/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:58:in require' from /usr/local/rvm/rubies/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler.rb:174:inrequire' from /var/www/portal/config/application.rb:13:in <top (required)>' from /var/www/portal/config/environment.rb:2:inrequire' from /var/www/portal/config/environment.rb:2:in <top (required)>' from config.ru:3:inrequire' from config.ru:3:in block in <main>' from /usr/local/rvm/rubies/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/rack-2.2.3/lib/rack/builder.rb:116:ineval' from /usr/local/rvm/rubies/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/rack-2.2.3/lib/rack/builder.rb:116:in new_from_string' from /usr/local/rvm/rubies/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/rack-2.2.3/lib/rack/builder.rb:105:inload_file' from /usr/local/rvm/rubies/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/rack-2.2.3/lib/rack/builder.rb:66:in parse_file' from /usr/local/rvm/rubies/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/puma-5.0.2/lib/puma/configuration.rb:330:inload_rackup' from /usr/local/rvm/rubies/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/puma-5.0.2/lib/puma/configuration.rb:256:in app' from /usr/local/rvm/rubies/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/puma-5.0.2/lib/puma/runner.rb:141:inapp' from /usr/local/rvm/rubies/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/puma-5.0.2/lib/puma/runner.rb:148:in start_server' from /usr/local/rvm/rubies/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/puma-5.0.2/lib/puma/cluster.rb:289:inworker' from /usr/local/rvm/rubies/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/puma-5.0.2/lib/puma/cluster.rb:171:in block in spawn_worker' from /usr/local/rvm/rubies/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/puma-5.0.2/lib/puma/cluster.rb:171:infork' from /usr/local/rvm/rubies/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/puma-5.0.2/lib/puma/cluster.rb:171:in spawn_worker' from /usr/local/rvm/rubies/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/puma-5.0.2/lib/puma/cluster.rb:153:inblock in spawn_workers' from /usr/local/rvm/rubies/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/puma-5.0.2/lib/puma/cluster.rb:146:in times' from /usr/local/rvm/rubies/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/puma-5.0.2/lib/puma/cluster.rb:146:inspawn_workers' from /usr/local/rvm/rubies/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/puma-5.0.2/lib/puma/cluster.rb:217:in check_workers' from /usr/local/rvm/rubies/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/puma-5.0.2/lib/puma/cluster.rb:573:inrun' from /usr/local/rvm/rubies/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/puma-5.0.2/lib/puma/launcher.rb:171:in run' from /usr/local/rvm/rubies/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/puma-5.0.2/lib/puma/cli.rb:80:inrun' from /usr/local/rvm/rubies/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/puma-5.0.2/bin/puma:10:in <top (required)>' from /usr/local/rvm/rubies/ruby-2.6.6/bin/puma:23:inload' from /usr/local/rvm/rubies/ruby-2.6.6/bin/puma:23:in <main>' from /usr/local/rvm/rubies/ruby-2.6.6/bin/ruby_executable_hooks:24:ineval' from /usr/local/rvm/rubies/ruby-2.6.6/bin/ruby_executable_hooks:24:in <main>'

When degrading to 2.8.1 the exception goes away.

Best regards, Thomas Balsløv.

zitooon commented 3 years ago

Same error. We use Rails 5.1.7 with ruby 2.6.2 and Puma 5.0.2.

Thanks for the great work ! Olivier de Robert

ilvez commented 3 years ago

Same error. Rails 6.0.3.3, Ruby 2.5.5, Puma 4.3.6.

jcoglan commented 3 years ago

I believe this change is the source of the problem: referring to VERSION without having explicitly loaded that constant. It's stopping our Rails app from booting.

https://github.com/BetterErrors/better_errors/compare/v2.8.1..master#diff-5e3c1d57ea649185a86b730f951f5a18R43

addisonmartin commented 3 years ago

I've submitted a fix: https://github.com/BetterErrors/better_errors/pull/480

RobinDaugherty commented 3 years ago

Very sorry for my mistake everyone, release 2.8.3 fixes this and is live (and I tested it in an app). Thank you @addisonmartin and @peaonunes for the PRs!

thomasbalsloev commented 3 years ago

Thanks guys!! @RobinDaugherty, @addisonmartin, @peaonunes