Crono fails to start with Web UI route active on Rails 5 #36

Closed
opened 2025-12-29 00:21:40 +01:00 by adam · 2 comments
Owner

Originally created by @cseelus on GitHub (Sep 20, 2016).

First thanks for your work. We use Crono in production for over a year now and it has kicked of tens of thousands of jobs on our servers.

Upgrading one of our apps to Rails 5 we encountered a problem though:

Running the Crono gem works as long as the route to the Web UI (mount Crono::Web, at: '/crono') is not active. With the route added, crono doesn't start locally as well as on our production machine (Heroku).

We can reproduce this problem within a clean new Rails 5.0.0.1 app with only the Crono gem added as well.

Error log from development machine (macOS 10.11.6 with Ruby 2.3.1, paths shortened for readability):

bundler: failed to load command: crono (/bin/crono)
LoadError: cannot load such file -- rack/showexceptions
  /lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require'
  /lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `block in require'
  /lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:259:in `load_dependency'
  /lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require'
  /lib/ruby/gems/2.3.0/gems/sinatra-1.0/lib/sinatra/showexceptions.rb:1:in `<top (required)>'
  /lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require'
  /lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `block in require'
  /lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:259:in `load_dependency'
  /lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require'
  /lib/ruby/gems/2.3.0/gems/sinatra-1.0/lib/sinatra/base.rb:6:in `<top (required)>'
  /lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require'
  /lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `block in require'
  /lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:259:in `load_dependency'
  /lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require'
  /lib/ruby/gems/2.3.0/gems/crono-1.0.3/lib/crono/web.rb:2:in `<top (required)>'
  /lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require'
  /lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `block in require'
  /lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:259:in `load_dependency'
  /lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require'
  /Users/chris/Sites/crono/config/routes.rb:2:in `block in <top (required)>'
  /lib/ruby/gems/2.3.0/gems/actionpack-5.0.0.1/lib/action_dispatch/routing/route_set.rb:389:in `instance_exec'
  /lib/ruby/gems/2.3.0/gems/actionpack-5.0.0.1/lib/action_dispatch/routing/route_set.rb:389:in `eval_block'
  /lib/ruby/gems/2.3.0/gems/actionpack-5.0.0.1/lib/action_dispatch/routing/route_set.rb:371:in `draw'
  /Users/chris/Sites/crono/config/routes.rb:1:in `<top (required)>'
  /lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:287:in `load'
  /lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:287:in `block in load'
  /lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:259:in `load_dependency'
  /lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:287:in `load'
  /lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
  /lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/application/routes_reloader.rb:40:in `each'
  /lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/application/routes_reloader.rb:40:in `load_paths'
  /lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/application/routes_reloader.rb:16:in `reload!'
  /lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/application/routes_reloader.rb:26:in `block in updater'
  /lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/file_update_checker.rb:77:in `execute'
  /lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/application/routes_reloader.rb:27:in `updater'
  /lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated'
  /lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/application/finisher.rb:119:in `block in <module:Finisher>'
  /lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/initializable.rb:30:in `instance_exec'
  /lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/initializable.rb:30:in `run'
  /lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/initializable.rb:55:in `block in run_initializers'
  /lib/ruby/2.3.0/tsort.rb:228:in `block in tsort_each'
  /lib/ruby/2.3.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
  /lib/ruby/2.3.0/tsort.rb:431:in `each_strongly_connected_component_from'
  /lib/ruby/2.3.0/tsort.rb:349:in `block in each_strongly_connected_component'
  /lib/ruby/2.3.0/tsort.rb:347:in `each'
  /lib/ruby/2.3.0/tsort.rb:347:in `call'
  /lib/ruby/2.3.0/tsort.rb:347:in `each_strongly_connected_component'
  /lib/ruby/2.3.0/tsort.rb:226:in `tsort_each'
  /lib/ruby/2.3.0/tsort.rb:205:in `tsort_each'
  /lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/initializable.rb:54:in `run_initializers'
  /lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/application.rb:352:in `initialize!'
  /Users/chris/Sites/crono/config/environment.rb:5:in `<top (required)>'
  /lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require'
  /lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `block in require'
  /lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:259:in `load_dependency'
  /lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require'
  /lib/ruby/gems/2.3.0/gems/crono-1.0.3/lib/crono/cli.rb:84:in `load_rails'
  /lib/ruby/gems/2.3.0/gems/crono-1.0.3/lib/crono/cli.rb:28:in `run'
  /lib/ruby/gems/2.3.0/gems/crono-1.0.3/exe/crono:8:in `<top (required)>'
  /bin/crono:23:in `load'
  /bin/crono:23:in `<top (required)>'
Originally created by @cseelus on GitHub (Sep 20, 2016). First thanks for your work. We use Crono in production for over a year now and it has kicked of tens of thousands of jobs on our servers. Upgrading one of our apps to Rails 5 we encountered a problem though: Running the Crono gem works as long as the route to the Web UI (`mount Crono::Web, at: '/crono'`) is not active. With the route added, `crono` doesn't start locally as well as on our production machine (Heroku). We can reproduce this problem within a clean new Rails 5.0.0.1 app with only the Crono gem added as well. Error log from development machine (macOS 10.11.6 with Ruby 2.3.1, paths shortened for readability): ``` log bundler: failed to load command: crono (/bin/crono) LoadError: cannot load such file -- rack/showexceptions /lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require' /lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `block in require' /lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:259:in `load_dependency' /lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require' /lib/ruby/gems/2.3.0/gems/sinatra-1.0/lib/sinatra/showexceptions.rb:1:in `<top (required)>' /lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require' /lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `block in require' /lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:259:in `load_dependency' /lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require' /lib/ruby/gems/2.3.0/gems/sinatra-1.0/lib/sinatra/base.rb:6:in `<top (required)>' /lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require' /lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `block in require' /lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:259:in `load_dependency' /lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require' /lib/ruby/gems/2.3.0/gems/crono-1.0.3/lib/crono/web.rb:2:in `<top (required)>' /lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require' /lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `block in require' /lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:259:in `load_dependency' /lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require' /Users/chris/Sites/crono/config/routes.rb:2:in `block in <top (required)>' /lib/ruby/gems/2.3.0/gems/actionpack-5.0.0.1/lib/action_dispatch/routing/route_set.rb:389:in `instance_exec' /lib/ruby/gems/2.3.0/gems/actionpack-5.0.0.1/lib/action_dispatch/routing/route_set.rb:389:in `eval_block' /lib/ruby/gems/2.3.0/gems/actionpack-5.0.0.1/lib/action_dispatch/routing/route_set.rb:371:in `draw' /Users/chris/Sites/crono/config/routes.rb:1:in `<top (required)>' /lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:287:in `load' /lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:287:in `block in load' /lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:259:in `load_dependency' /lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:287:in `load' /lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/application/routes_reloader.rb:40:in `block in load_paths' /lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/application/routes_reloader.rb:40:in `each' /lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/application/routes_reloader.rb:40:in `load_paths' /lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/application/routes_reloader.rb:16:in `reload!' /lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/application/routes_reloader.rb:26:in `block in updater' /lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/file_update_checker.rb:77:in `execute' /lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/application/routes_reloader.rb:27:in `updater' /lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated' /lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/application/finisher.rb:119:in `block in <module:Finisher>' /lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/initializable.rb:30:in `instance_exec' /lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/initializable.rb:30:in `run' /lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/initializable.rb:55:in `block in run_initializers' /lib/ruby/2.3.0/tsort.rb:228:in `block in tsort_each' /lib/ruby/2.3.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component' /lib/ruby/2.3.0/tsort.rb:431:in `each_strongly_connected_component_from' /lib/ruby/2.3.0/tsort.rb:349:in `block in each_strongly_connected_component' /lib/ruby/2.3.0/tsort.rb:347:in `each' /lib/ruby/2.3.0/tsort.rb:347:in `call' /lib/ruby/2.3.0/tsort.rb:347:in `each_strongly_connected_component' /lib/ruby/2.3.0/tsort.rb:226:in `tsort_each' /lib/ruby/2.3.0/tsort.rb:205:in `tsort_each' /lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/initializable.rb:54:in `run_initializers' /lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/application.rb:352:in `initialize!' /Users/chris/Sites/crono/config/environment.rb:5:in `<top (required)>' /lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require' /lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `block in require' /lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:259:in `load_dependency' /lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require' /lib/ruby/gems/2.3.0/gems/crono-1.0.3/lib/crono/cli.rb:84:in `load_rails' /lib/ruby/gems/2.3.0/gems/crono-1.0.3/lib/crono/cli.rb:28:in `run' /lib/ruby/gems/2.3.0/gems/crono-1.0.3/exe/crono:8:in `<top (required)>' /bin/crono:23:in `load' /bin/crono:23:in `<top (required)>' ```
adam added the bug label 2025-12-29 00:21:40 +01:00
adam closed this issue 2025-12-29 00:21:40 +01:00
Author
Owner

@plashchynski commented on GitHub (Sep 22, 2016):

Hello @cseelus
Thank you for the good words.
This issue is related to https://github.com/sinatra/sinatra/issues/1055
You can fix it by using the latest version of sinatra:

gem 'sinatra', '2.0.0.beta2', require: nil

Thank you and good luck.

@plashchynski commented on GitHub (Sep 22, 2016): Hello @cseelus Thank you for the good words. This issue is related to https://github.com/sinatra/sinatra/issues/1055 You can fix it by using the latest version of sinatra: ``` gem 'sinatra', '2.0.0.beta2', require: nil ``` Thank you and good luck.
Author
Owner

@cseelus commented on GitHub (Sep 22, 2016):

Thanks @plashchynski, this works :-)

@cseelus commented on GitHub (Sep 22, 2016): Thanks @plashchynski, this works :-)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/crono#36