I am using rails, docker.
In my old application, there are some old methods and gems.
In my Gemfile, I added
group :development, :test do
gem 'guard-test', github: 'guard/guard-test'
end
Then run docker-compose build and docker-compose up, the error message is:
sidekiq_1 | /usr/local/bundle/gems/bundler-1.10.6/lib/bundler/source/git/git_proxy.rb:155:in `allowed_in_path': The git source git://github.com/guard/guard-test.git is not yet checked out. Please run `bundle install` before trying to start your application (Bundler::GitError)
sidekiq_1 | from /usr/local/bundle/gems/bundler-1.10.6/lib/bundler/source/git/git_proxy.rb:47:in `revision'
sidekiq_1 | from /usr/local/bundle/gems/bundler-1.10.6/lib/bundler/source/git.rb:215:in `revision'
sidekiq_1 | from /usr/local/bundle/gems/bundler-1.10.6/lib/bundler/source/git.rb:85:in `install_path'
sidekiq_1 | from /usr/local/bundle/gems/bundler-1.10.6/lib/bundler/source/path.rb:110:in `expanded_path'
sidekiq_1 | from /usr/local/bundle/gems/bundler-1.10.6/lib/bundler/source/path.rb:132:in `load_spec_files'
sidekiq_1 | from /usr/local/bundle/gems/bundler-1.10.6/lib/bundler/source/git.rb:188:in `load_spec_files'
sidekiq_1 | from /usr/local/bundle/gems/bundler-1.10.6/lib/bundler/source/path.rb:92:in `local_specs'
sidekiq_1 | from /usr/local/bundle/gems/bundler-1.10.6/lib/bundler/source/git.rb:159:in `specs'
sidekiq_1 | from /usr/local/bundle/gems/bundler-1.10.6/lib/bundler/definition.rb:550:in `block in converge_locked_specs'
sidekiq_1 | from /usr/local/bundle/gems/bundler-1.10.6/lib/bundler/definition.rb:539:in `each'
sidekiq_1 | from /usr/local/bundle/gems/bundler-1.10.6/lib/bundler/definition.rb:539:in `converge_locked_specs'
sidekiq_1 | from /usr/local/bundle/gems/bundler-1.10.6/lib/bundler/definition.rb:195:in `resolve'
sidekiq_1 | from /usr/local/bundle/gems/bundler-1.10.6/lib/bundler/definition.rb:140:in `specs'
sidekiq_1 | from /usr/local/bundle/gems/bundler-1.10.6/lib/bundler/definition.rb:185:in `specs_for'
sidekiq_1 | from /usr/local/bundle/gems/bundler-1.10.6/lib/bundler/definition.rb:174:in `requested_specs'
sidekiq_1 | from /usr/local/bundle/gems/bundler-1.10.6/lib/bundler/environment.rb:18:in `requested_specs'
sidekiq_1 | from /usr/local/bundle/gems/bundler-1.10.6/lib/bundler/runtime.rb:13:in `setup'
sidekiq_1 | from /usr/local/bundle/gems/bundler-1.10.6/lib/bundler.rb:127:in `setup'
sidekiq_1 | from /usr/local/bundle/gems/bundler-1.10.6/lib/bundler/setup.rb:18:in `<top (required)>'
sidekiq_1 | from /usr/local/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
sidekiq_1 | from /usr/local/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
web_1 | /usr/local/bundle/gems/bundler-1.10.6/lib/bundler/source/git/git_proxy.rb:155:in `allowed_in_path': The git source git://github.com/guard/guard-test.git is not yet checked out. Please run `bundle install` before trying to start your application (Bundler::GitError)
web_1 | from /usr/local/bundle/gems/bundler-1.10.6/lib/bundler/source/git/git_proxy.rb:47:in `revision'
web_1 | from /usr/local/bundle/gems/bundler-1.10.6/lib/bundler/source/git.rb:215:in `revision'
web_1 | from /usr/local/bundle/gems/bundler-1.10.6/lib/bundler/source/git.rb:85:in `install_path'
web_1 | from /usr/local/bundle/gems/bundler-1.10.6/lib/bundler/source/path.rb:110:in `expanded_path'
web_1 | from /usr/local/bundle/gems/bundler-1.10.6/lib/bundler/source/path.rb:132:in `load_spec_files'
web_1 | from /usr/local/bundle/gems/bundler-1.10.6/lib/bundler/source/git.rb:188:in `load_spec_files'
web_1 | from /usr/local/bundle/gems/bundler-1.10.6/lib/bundler/source/path.rb:92:in `local_specs'
web_1 | from /usr/local/bundle/gems/bundler-1.10.6/lib/bundler/source/git.rb:159:in `specs'
web_1 | from /usr/local/bundle/gems/bundler-1.10.6/lib/bundler/definition.rb:550:in `block in converge_locked_specs'
web_1 | from /usr/local/bundle/gems/bundler-1.10.6/lib/bundler/definition.rb:539:in `each'
web_1 | from /usr/local/bundle/gems/bundler-1.10.6/lib/bundler/definition.rb:539:in `converge_locked_specs'
web_1 | from /usr/local/bundle/gems/bundler-1.10.6/lib/bundler/definition.rb:195:in `resolve'
web_1 | from /usr/local/bundle/gems/bundler-1.10.6/lib/bundler/definition.rb:140:in `specs'
web_1 | from /usr/local/bundle/gems/bundler-1.10.6/lib/bundler/definition.rb:185:in `specs_for'
web_1 | from /usr/local/bundle/gems/bundler-1.10.6/lib/bundler/definition.rb:174:in `requested_specs'
web_1 | from /usr/local/bundle/gems/bundler-1.10.6/lib/bundler/environment.rb:18:in `requested_specs'
web_1 | from /usr/local/bundle/gems/bundler-1.10.6/lib/bundler/runtime.rb:13:in `setup'
web_1 | from /usr/local/bundle/gems/bundler-1.10.6/lib/bundler.rb:127:in `setup'
web_1 | from /usr/local/bundle/gems/bundler-1.10.6/lib/bundler/setup.rb:18:in `<top (required)>'
web_1 | from /usr/local/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
web_1 | from /usr/local/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
testapp_sidekiq_1 exited with code 1
testapp_web_1 exited with code 1
What's meaning about that?
You need to run bundle install in your Docker container.
Related
I updated my Ruby version to 3.1.3, but I was keep getting the following error and could not fix it, so I downgraded Ruby version back to 3.1.2.
However, I am keep getting the same error and I tried reinstalling all the gems and updating all the gems, but still getting the error. I would really appreciate if someone can help me out because I could not figure this out for very long time. I don't think I need to install JRuby separately or something because it used to work fine.
Thanks in advance!
20:23:24 web.1 | C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:17:in `require': cannot load such file -- jruby (LoadError)
20:23:24 web.1 | from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:17:in `require'
20:23:24 web.1 | from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jruby-openssl-0.9.4/lib/jopenssl/load.rb:13:in `<main>'
20:23:24 web.1 | from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
20:23:24 web.1 | from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
20:23:24 web.1 | from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jruby-openssl-0.9.4/lib/openssl.rb:1:in `<main>'
20:23:24 web.1 | from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
20:23:24 web.1 | from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
20:23:24 web.1 | from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/activesupport-7.0.4/lib/active_support/key_generator.rb:4:in `<main>'
20:23:24 web.1 | from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
20:23:24 web.1 | from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
20:23:24 web.1 | from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/application.rb:6:in `<main>'
20:23:24 web.1 | from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
20:23:24 web.1 | from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
20:23:24 web.1 | from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails.rb:13:in `<main>'
20:23:24 web.1 | from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
20:23:24 web.1 | from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
20:23:25 web.1 | from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/commands/server/server_command.rb:5:in `<main>'
20:23:25 web.1 | from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
20:23:25 web.1 | from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
20:23:25 web.1 | from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/command/behavior.rb:44:in `block (2 levels) in lookup'
20:23:25 web.1 | from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/command/behavior.rb:40:in `each'
20:23:25 web.1 | from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/command/behavior.rb:40:in `block in lookup'
20:23:25 web.1 | from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/command/behavior.rb:39:in `each'
20:23:25 web.1 | from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/command/behavior.rb:39:in `lookup'
20:23:25 web.1 | from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/command.rb:73:in `find_by_namespace'
20:23:25 web.1 | from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/command.rb:46:in `invoke'
20:23:25 web.1 | from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/commands.rb:18:in `<main>'
20:23:25 web.1 | from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_requ from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/foreman-0.87.2/lib/foreman/vendor/thor/lib/thor/base.rb:444:in `start'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/foreman-0.87.2/bin/foreman:7:in `<top (required)>' from C:/Ruby31-x64/bin/foreman:32:in `load'
from C:/Ruby31-x64/bin/foreman:32:in `<main>'
It seems like one of the gems was causing the problem. I rolled back everything to before state and the server is working again.
The gem was gem 'google-auth'
I'm attempting to send exceptions to a slack channel. This was my set up:
Added the following to my Gemfile
gem 'exception_notification'
gem 'slack-notifier'
Created a new initializer config/initializers/errors.rb
# Works in development with or without this require
require 'exception_notification'
Rails.application.config.middleware.use(
ExceptionNotification::Rack,
:slack => {
:webhook_url => ENV["SLACK_ERROR_WEBHOOOK_URL"]
}
)
I have rebuilt my docker images and deleted the gem cache volumes.
This works properly in my development environment (errors get sent to slack), but isn't working on my production server. The only real difference that I can think of between the two is the RAILS_ENV value, at least configuration-wise. I'm fairly new to Rails however, as well as deploying to a production environment.
Immediately upon starting the app (docker-compose up) it exits with the following error:
/usr/local/bundle/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:34:in `require': cannot load such file -- exception_notification (LoadError)
app_1 | from /usr/local/bundle/gems/zeitwerk-2.3.0/lib/zeitwerk/kernel.rb:23:in `require'
app_1 | from /usr/local/bundle/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:325:in `block in require'
app_1 | from /usr/local/bundle/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:291:in `load_dependency'
app_1 | from /usr/local/bundle/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:325:in `require'
app_1 | from /app/config/initializers/errors.rb:1:in `<main>'
app_1 | from /usr/local/bundle/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:55:in `load'
app_1 | from /usr/local/bundle/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:55:in `load'
app_1 | from /usr/local/bundle/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:319:in `block in load'
app_1 | from /usr/local/bundle/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:291:in `load_dependency'
app_1 | from /usr/local/bundle/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:319:in `load'
app_1 | from /usr/local/bundle/gems/railties-6.0.2.1/lib/rails/engine.rb:667:in `block in load_config_initializer'
app_1 | from /usr/local/bundle/gems/activesupport-6.0.2.1/lib/active_support/notifications.rb:182:in `instrument'
app_1 | from /usr/local/bundle/gems/railties-6.0.2.1/lib/rails/engine.rb:666:in `load_config_initializer'
app_1 | from /usr/local/bundle/gems/railties-6.0.2.1/lib/rails/engine.rb:624:in `block (2 levels) in <class:Engine>'
app_1 | from /usr/local/bundle/gems/railties-6.0.2.1/lib/rails/engine.rb:623:in `each'
app_1 | from /usr/local/bundle/gems/railties-6.0.2.1/lib/rails/engine.rb:623:in `block in <class:Engine>'
app_1 | from /usr/local/bundle/gems/railties-6.0.2.1/lib/rails/initializable.rb:32:in `instance_exec'
app_1 | from /usr/local/bundle/gems/railties-6.0.2.1/lib/rails/initializable.rb:32:in `run'
app_1 | from /usr/local/bundle/gems/railties-6.0.2.1/lib/rails/initializable.rb:61:in `block in run_initializers'
app_1 | from /usr/local/lib/ruby/2.6.0/tsort.rb:228:in `block in tsort_each'
app_1 | from /usr/local/lib/ruby/2.6.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
app_1 | from /usr/local/lib/ruby/2.6.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
app_1 | from /usr/local/lib/ruby/2.6.0/tsort.rb:431:in `each_strongly_connected_component_from'
app_1 | from /usr/local/lib/ruby/2.6.0/tsort.rb:421:in `block in each_strongly_connected_component_from'
app_1 | from /usr/local/bundle/gems/railties-6.0.2.1/lib/rails/initializable.rb:50:in `each'
app_1 | from /usr/local/bundle/gems/railties-6.0.2.1/lib/rails/initializable.rb:50:in `tsort_each_child'
app_1 | from /usr/local/lib/ruby/2.6.0/tsort.rb:415:in `call'
app_1 | from /usr/local/lib/ruby/2.6.0/tsort.rb:415:in `each_strongly_connected_component_from'
app_1 | from /usr/local/lib/ruby/2.6.0/tsort.rb:349:in `block in each_strongly_connected_component'
app_1 | from /usr/local/lib/ruby/2.6.0/tsort.rb:347:in `each'
app_1 | from /usr/local/lib/ruby/2.6.0/tsort.rb:347:in `call'
app_1 | from /usr/local/lib/ruby/2.6.0/tsort.rb:347:in `each_strongly_connected_component'
app_1 | from /usr/local/lib/ruby/2.6.0/tsort.rb:226:in `tsort_each'
app_1 | from /usr/local/lib/ruby/2.6.0/tsort.rb:205:in `tsort_each'
app_1 | from /usr/local/bundle/gems/railties-6.0.2.1/lib/rails/initializable.rb:60:in `run_initializers'
app_1 | from /usr/local/bundle/gems/railties-6.0.2.1/lib/rails/application.rb:363:in `initialize!'
app_1 | from /app/config/environment.rb:5:in `<main>'
app_1 | from /usr/local/bundle/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
app_1 | from /usr/local/bundle/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
app_1 | from /usr/local/bundle/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
app_1 | from /usr/local/bundle/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
app_1 | from /usr/local/bundle/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
app_1 | from /usr/local/bundle/gems/zeitwerk-2.3.0/lib/zeitwerk/kernel.rb:23:in `require'
app_1 | from /usr/local/bundle/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:325:in `block in require'
app_1 | from /usr/local/bundle/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:291:in `load_dependency'
app_1 | from /usr/local/bundle/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:325:in `require'
app_1 | from /usr/local/bundle/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:49:in `require_relative'
app_1 | from config.ru:3:in `block in <main>'
app_1 | from /usr/local/bundle/gems/rack-2.2.2/lib/rack/builder.rb:116:in `eval'
app_1 | from /usr/local/bundle/gems/rack-2.2.2/lib/rack/builder.rb:116:in `new_from_string'
app_1 | from /usr/local/bundle/gems/rack-2.2.2/lib/rack/builder.rb:105:in `load_file'
app_1 | from /usr/local/bundle/gems/rack-2.2.2/lib/rack/builder.rb:66:in `parse_file'
app_1 | from /usr/local/bundle/gems/rack-2.2.2/lib/rack/server.rb:349:in `build_app_and_options_from_config'
app_1 | from /usr/local/bundle/gems/rack-2.2.2/lib/rack/server.rb:249:in `app'
app_1 | from /usr/local/bundle/gems/rack-2.2.2/lib/rack/server.rb:422:in `wrapped_app'
app_1 | from /usr/local/bundle/gems/rack-2.2.2/lib/rack/server.rb:312:in `block in start'
app_1 | from /usr/local/bundle/gems/rack-2.2.2/lib/rack/server.rb:379:in `handle_profiling'
app_1 | from /usr/local/bundle/gems/rack-2.2.2/lib/rack/server.rb:311:in `start'
app_1 | from /usr/local/bundle/gems/railties-6.0.2.1/lib/rails/commands/server/server_command.rb:39:in `start'
app_1 | from /usr/local/bundle/gems/railties-6.0.2.1/lib/rails/commands/server/server_command.rb:147:in `block in perform'
app_1 | from /usr/local/bundle/gems/railties-6.0.2.1/lib/rails/commands/server/server_command.rb:138:in `tap'
app_1 | from /usr/local/bundle/gems/railties-6.0.2.1/lib/rails/commands/server/server_command.rb:138:in `perform'
app_1 | from /usr/local/bundle/gems/thor-1.0.1/lib/thor/command.rb:27:in `run'
app_1 | from /usr/local/bundle/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command'
app_1 | from /usr/local/bundle/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch'
app_1 | from /usr/local/bundle/gems/railties-6.0.2.1/lib/rails/command/base.rb:69:in `perform'
app_1 | from /usr/local/bundle/gems/railties-6.0.2.1/lib/rails/command.rb:46:in `invoke'
app_1 | from /usr/local/bundle/gems/railties-6.0.2.1/lib/rails/commands.rb:18:in `<main>'
app_1 | from /usr/local/bundle/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
app_1 | from /usr/local/bundle/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
app_1 | from /usr/local/bundle/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
app_1 | from /usr/local/bundle/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
app_1 | from /usr/local/bundle/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
app_1 | from /usr/local/bundle/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:325:in `block in require'
app_1 | from /usr/local/bundle/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:291:in `load_dependency'
app_1 | from /usr/local/bundle/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:325:in `require'
app_1 | from bin/rails:4:in `<main>'
I've verified that the gem exception_notification is indeed installed by running docker exec -it <container-name> gem list, which includes exception_notification (4.4.3) in the output, and also running docker exec -it <container-name> gem which exception_notification which gives /usr/local/bundle/gems/exception_notification-4.4.3/lib/exception_notification.rb
Running Ruby on Rails v6.0.2 and Ruby v2.6.3
I had some similar problems when using Rails and Docker. Bootsnap cache may be stale.
Try removing the cache
rm tmp/cache/bootsnap-load-path-cache
You might also try restarting Spring
spring stop
It should restart automatically.
Try require 'exception_notification/rails'
I've just created a new Vagrant box to be able to develop my Rails app. The box is brand new and has Ruby, MySQL etc installed to be able to develop.
I've installed all gems etc but when I try to start the app I get the following:
vagrant#neiltongesite:/vagrant/source$ bundle exec foreman start
17:45:02 rails.1 | started with pid 5910
17:45:05 rails.1 | /home/vagrant/.gem/ruby/2.2.7/gems/sprockets-rails-3.2.0/lib/sprockets/railtie.rb:108:in `block in <class:Railtie>': undefined method `+' for false:FalseClass (NoMethodError)
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/railties-4.2.5.1/lib/rails/initializable.rb:30:in `instance_exec'
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/railties-4.2.5.1/lib/rails/initializable.rb:30:in `run'
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/railties-4.2.5.1/lib/rails/initializable.rb:55:in `block in run_initializers'
17:45:05 rails.1 | from /opt/rubies/ruby-2.2.7/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'
17:45:05 rails.1 | from /opt/rubies/ruby-2.2.7/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
17:45:05 rails.1 | from /opt/rubies/ruby-2.2.7/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from'
17:45:05 rails.1 | from /opt/rubies/ruby-2.2.7/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'
17:45:05 rails.1 | from /opt/rubies/ruby-2.2.7/lib/ruby/2.2.0/tsort.rb:345:in `each'
17:45:05 rails.1 | from /opt/rubies/ruby-2.2.7/lib/ruby/2.2.0/tsort.rb:345:in `call'
17:45:05 rails.1 | from /opt/rubies/ruby-2.2.7/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'
17:45:05 rails.1 | from /opt/rubies/ruby-2.2.7/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'
17:45:05 rails.1 | from /opt/rubies/ruby-2.2.7/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each'
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/railties-4.2.5.1/lib/rails/initializable.rb:54:in `run_initializers'
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/railties-4.2.5.1/lib/rails/application.rb:352:in `initialize!'
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/railties-4.2.5.1/lib/rails/railtie.rb:194:in `public_send'
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/railties-4.2.5.1/lib/rails/railtie.rb:194:in `method_missing'
17:45:05 rails.1 | from /vagrant/source/config/environment.rb:5:in `<top (required)>'
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:274:in `require'
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:274:in `block in require'
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:240:in `load_dependency'
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:274:in `require'
17:45:05 rails.1 | from /vagrant/source/config.ru:3:in `block in <main>'
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/rack-1.6.5/lib/rack/builder.rb:55:in `instance_eval'
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/rack-1.6.5/lib/rack/builder.rb:55:in `initialize'
17:45:05 rails.1 | from /vagrant/source/config.ru:in `new'
17:45:05 rails.1 | from /vagrant/source/config.ru:in `<main>'
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/rack-1.6.5/lib/rack/builder.rb:49:in `eval'
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/rack-1.6.5/lib/rack/builder.rb:49:in `new_from_string'
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/rack-1.6.5/lib/rack/builder.rb:40:in `parse_file'
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/rack-1.6.5/lib/rack/server.rb:299:in `build_app_and_options_from_config'
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/rack-1.6.5/lib/rack/server.rb:208:in `app'
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/railties-4.2.5.1/lib/rails/commands/server.rb:61:in `app'
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/rack-1.6.5/lib/rack/server.rb:336:in `wrapped_app'
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/railties-4.2.5.1/lib/rails/commands/server.rb:139:in `log_to_stdout'
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/railties-4.2.5.1/lib/rails/commands/server.rb:78:in `start'
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:80:in `block in server'
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:75:in `tap'
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:75:in `server'
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/railties-4.2.5.1/lib/rails/commands.rb:17:in `<top (required)>'
17:45:05 rails.1 | from bin/rails:4:in `require'
17:45:05 rails.1 | from bin/rails:4:in `<main>'
17:45:05 rails.1 | => Booting Puma
17:45:05 rails.1 | => Rails 4.2.5.1 application starting in development on http://0.0.0.0:3000
17:45:05 rails.1 | => Run `rails server -h` for more startup options
17:45:05 rails.1 | => Ctrl-C to shutdown server
17:45:05 rails.1 | Exiting
17:45:05 rails.1 | exited with code 1
17:45:05 system | sending SIGTERM to all processes
I've looked but can't seem to figure out what is causing it.
Anyone able to point me in the right direction?
The exception is thrown on this line, so I guess you have the following somewhere in your configuration files:
config.assets.precompile = false
This configuration setting should define an array of assets that you want to be precompiled, it should not be set to false. See the Rails guides for more info.
To test this hypothesis I configured a test Rails 5 project with the above line and got the same exception:
.../gems/sprockets-rails-3.2.0/lib/sprockets/railtie.rb:108:in `block in <class:Railtie>': undefined method `+' for false:FalseClass (NoMethodError)
I have a few jobs that query some external APIs. I have two types of jobs.
One job to gather a large amount of data.
And another to keep the data updated every fifteen minutes.
I would like the bulk job to fire one time on deployment to collect that bulk data, then lay dormant while the update job executes on set intervals to keep the data topped off.
How does one set a job to fire one time on deployment?
Edit:
This is what I've tried so far.
With a rake task
# application.rb
config.after_initialize do
Rails.application.load_tasks # Load our Event collection task.
Rake::Task['initialize_event_collection:build_eventbrite'].invoke
Rake::Task['initialize_event_collection:build_meetup'].invoke
end
namespace :initialize_event_collection do
desc "This task fetches Meetup and Eventbrite events in bulk on startup."
task :build_eventbrite do
FetchEventbriteJob.perform_later
end
task :build_meetup do
FetchMeetupJob.perform_later
end
end
It looks like it starts but then it doesn't really go anywhere:
Redis and Puma stuff above...
sidekiq_1 | 2017-03-21T02:20:36.829Z 1 TID-gq6vufr4k INFO: Booting Sidekiq 4.2.3 with redis options {:url=>"redis://redis:6379/"}
sidekiq_1 | 2017-03-21T02:20:37.449Z 1 TID-gq6vufr4k INFO: Running in ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]
sidekiq_1 | 2017-03-21T02:20:37.449Z 1 TID-gq6vufr4k INFO: See LICENSE and the LGPL-3.0 for licensing details.
sidekiq_1 | 2017-03-21T02:20:37.450Z 1 TID-gq6vufr4k INFO: Upgrade to Sidekiq Pro for more features and support: http://sidekiq.org
sidekiq_1 | 2017-03-21T02:20:37.456Z 1 TID-gq6vufr4k INFO: Loading Schedule
sidekiq_1 | 2017-03-21T02:20:37.456Z 1 TID-gq6vufr4k INFO: Schedule empty! Set Sidekiq.schedule
sidekiq_1 | 2017-03-21T02:20:37.457Z 1 TID-gq6vufr4k INFO: Schedules Loaded
sidekiq_1 | 2017-03-21T02:20:37.463Z 1 TID-gq6vufr4k INFO: Reloading Schedule
sidekiq_1 | 2017-03-21T02:20:37.464Z 1 TID-gq6vufr4k INFO: Loading Schedule
sidekiq_1 | 2017-03-21T02:20:37.464Z 1 TID-gq6vufr4k INFO: Scheduling UpdateEventbriteJob {"cron"=>"*/15 * * * *", "class"=>"UpdateEventbriteJob"}
sidekiq_1 | 2017-03-21T02:20:37.969Z 1 TID-gq6vufr4k INFO: Scheduling UpdateMeetupJob {"cron"=>"*/15 * * * *", "class"=>"UpdateMeetupJob"}
sidekiq_1 | 2017-03-21T02:20:38.353Z 1 TID-gq6vufr4k INFO: Scheduling UpdateStatusJob {"cron"=>"0 0 * * *", "class"=>"UpdateStatusJob"}
sidekiq_1 | 2017-03-21T02:20:38.383Z 1 TID-gq6vufr4k INFO: Schedules Loaded
sidekiq_1 | 2017-03-21T02:20:38.383Z 1 TID-gq6vufr4k INFO: Starting processing, hit Ctrl-C to stop
sidekiq_1 | 2017-03-21T02:20:38.610Z 1 TID-gq6wf5uic FetchEventbriteJob JID-6803f9b93ce89e02ccb73d1d INFO: start
sidekiq_1 | 2017-03-21T02:20:38.623Z 1 TID-gq6wf5vp4 FetchEventbriteJob JID-79b83c0d2be3c647d8c8b52e INFO: start
sidekiq_1 | 2017-03-21T02:20:38.652Z 1 TID-gq6wf5v68 FetchMeetupJob JID-5c65f2262582a1e278b9986d INFO: start
sidekiq_1 | 2017-03-21T02:20:38.752Z 1 TID-gq6wf5tx8 FetchMeetupJob JID-cedc08eb695de6c14e371259 INFO: start
sidekiq_1 | 2017-03-21T02:20:38.854Z 1 TID-gq6wf5uqo FetchEventbriteJob JID-227879792a37d35bb6815a5d INFO: start
web_1 | Puma starting in single mode...
web_1 | * Version 3.6.0 (ruby 2.3.1-p112), codename: Sleepy Sunday Serenity
web_1 | * Min threads: 5, max threads: 5
web_1 | * Environment: development
web_1 | * Listening on tcp://0.0.0.0:3000
web_1 | Use Ctrl-C to stop
I've tried to call a method that calls the same job:
# application.rb
config.after_initialize do
Event.build_eventbrite
Event.build_meetup
end
# event.rb
def build_eventbrite
FetchEventbriteJob.perform_later
end
def build_meetup
FetchMeetupJob.perform_later
end
It looks like Rails doesn't like this approach
sidekiq_1 | 2017-03-21T02:29:23.858Z 1 TID-gqzwqq0wc INFO: Booting Sidekiq 4.2.3 with redis options {:url=>"redis://redis:6379/"}
sidekiq_1 | undefined method `build_eventbrite' for Event (call 'Event.connection' to establish a connection):Class
sidekiq_1 | /usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/dynamic_matchers.rb:21:in `method_missing'
sidekiq_1 | /work_project/config/application.rb:29:in `block in <class:Application>'
sidekiq_1 | /usr/local/bundle/gems/activesupport-5.0.0.1/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
sidekiq_1 | /usr/local/bundle/gems/activesupport-5.0.0.1/lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
sidekiq_1 | /usr/local/bundle/gems/activesupport-5.0.0.1/lib/active_support/lazy_load_hooks.rb:44:in `each'
sidekiq_1 | /usr/local/bundle/gems/activesupport-5.0.0.1/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
sidekiq_1 | /usr/local/bundle/gems/railties-5.0.0.1/lib/rails/application/finisher.rb:65:in `block in <module:Finisher>'
sidekiq_1 | /usr/local/bundle/gems/railties-5.0.0.1/lib/rails/initializable.rb:30:in `instance_exec'
sidekiq_1 | /usr/local/bundle/gems/railties-5.0.0.1/lib/rails/initializable.rb:30:in `run'
sidekiq_1 | /usr/local/bundle/gems/railties-5.0.0.1/lib/rails/initializable.rb:55:in `block in run_initializers'
sidekiq_1 | /usr/local/lib/ruby/2.3.0/tsort.rb:228:in `block in tsort_each'
sidekiq_1 | /usr/local/lib/ruby/2.3.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
sidekiq_1 | /usr/local/lib/ruby/2.3.0/tsort.rb:431:in `each_strongly_connected_component_from'
sidekiq_1 | /usr/local/lib/ruby/2.3.0/tsort.rb:349:in `block in each_strongly_connected_component'
sidekiq_1 | /usr/local/lib/ruby/2.3.0/tsort.rb:347:in `each'
sidekiq_1 | /usr/local/lib/ruby/2.3.0/tsort.rb:347:in `call'
sidekiq_1 | /usr/local/lib/ruby/2.3.0/tsort.rb:347:in `each_strongly_connected_component'
sidekiq_1 | /usr/local/lib/ruby/2.3.0/tsort.rb:226:in `tsort_each'
sidekiq_1 | /usr/local/lib/ruby/2.3.0/tsort.rb:205:in `tsort_each'
sidekiq_1 | /usr/local/bundle/gems/railties-5.0.0.1/lib/rails/initializable.rb:54:in `run_initializers'
sidekiq_1 | /usr/local/bundle/gems/railties-5.0.0.1/lib/rails/application.rb:352:in `initialize!'
sidekiq_1 | /work_project/config/environment.rb:5:in `<top (required)>'
sidekiq_1 | /usr/local/bundle/gems/sidekiq-4.2.3/lib/sidekiq/cli.rb:242:in `require'
sidekiq_1 | /usr/local/bundle/gems/sidekiq-4.2.3/lib/sidekiq/cli.rb:242:in `boot_system'
sidekiq_1 | /usr/local/bundle/gems/sidekiq-4.2.3/lib/sidekiq/cli.rb:50:in `run'
sidekiq_1 | /usr/local/bundle/gems/sidekiq-4.2.3/bin/sidekiq:12:in `<top (required)>'
sidekiq_1 | /usr/local/bundle/bin/sidekiq:17:in `load'
sidekiq_1 | /usr/local/bundle/bin/sidekiq:17:in `<top (required)>'
sidekiq_1 | /usr/local/bundle/gems/bundler-1.14.6/lib/bundler/cli/exec.rb:74:in `load'
sidekiq_1 | /usr/local/bundle/gems/bundler-1.14.6/lib/bundler/cli/exec.rb:74:in `kernel_load'
sidekiq_1 | /usr/local/bundle/gems/bundler-1.14.6/lib/bundler/cli/exec.rb:27:in `run'
sidekiq_1 | /usr/local/bundle/gems/bundler-1.14.6/lib/bundler/cli.rb:335:in `exec'
sidekiq_1 | /usr/local/bundle/gems/bundler-1.14.6/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
sidekiq_1 | /usr/local/bundle/gems/bundler-1.14.6/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
sidekiq_1 | /usr/local/bundle/gems/bundler-1.14.6/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
sidekiq_1 | /usr/local/bundle/gems/bundler-1.14.6/lib/bundler/cli.rb:20:in `dispatch'
sidekiq_1 | /usr/local/bundle/gems/bundler-1.14.6/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
sidekiq_1 | /usr/local/bundle/gems/bundler-1.14.6/lib/bundler/cli.rb:11:in `start'
sidekiq_1 | /usr/local/bundle/gems/bundler-1.14.6/exe/bundle:32:in `block in <top (required)>'
sidekiq_1 | /usr/local/bundle/gems/bundler-1.14.6/lib/bundler/friendly_errors.rb:121:in `with_friendly_errors'
sidekiq_1 | /usr/local/bundle/gems/bundler-1.14.6/exe/bundle:24:in `<top (required)>'
sidekiq_1 | /usr/local/bundle/bin/bundle:22:in `load'
sidekiq_1 | /usr/local/bundle/bin/bundle:22:in `<main>'
work_project_sidekiq_1 exited with code 1
web_1 | Exiting
web_1 | /usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/dynamic_matchers.rb:21:in `method_missing': undefined method `build_eventbrite' for Event (call 'Event.connection' to establish a connection):Class (NoMethodError)
web_1 | from /work_project/config/application.rb:29:in `block in <class:Application>'
web_1 | from /usr/local/bundle/gems/activesupport-5.0.0.1/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
web_1 | from /usr/local/bundle/gems/activesupport-5.0.0.1/lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
web_1 | from /usr/local/bundle/gems/activesupport-5.0.0.1/lib/active_support/lazy_load_hooks.rb:44:in `each'
web_1 | from /usr/local/bundle/gems/activesupport-5.0.0.1/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
web_1 | from /usr/local/bundle/gems/railties-5.0.0.1/lib/rails/application/finisher.rb:65:in `block in <module:Finisher>'
web_1 | from /usr/local/bundle/gems/railties-5.0.0.1/lib/rails/initializable.rb:30:in `instance_exec'
web_1 | from /usr/local/bundle/gems/railties-5.0.0.1/lib/rails/initializable.rb:30:in `run'
web_1 | from /usr/local/bundle/gems/railties-5.0.0.1/lib/rails/initializable.rb:55:in `block in run_initializers'
web_1 | from /usr/local/lib/ruby/2.3.0/tsort.rb:228:in `block in tsort_each'
web_1 | from /usr/local/lib/ruby/2.3.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
web_1 | from /usr/local/lib/ruby/2.3.0/tsort.rb:431:in `each_strongly_connected_component_from'
web_1 | from /usr/local/lib/ruby/2.3.0/tsort.rb:349:in `block in each_strongly_connected_component'
web_1 | from /usr/local/lib/ruby/2.3.0/tsort.rb:347:in `each'
web_1 | from /usr/local/lib/ruby/2.3.0/tsort.rb:347:in `call'
web_1 | from /usr/local/lib/ruby/2.3.0/tsort.rb:347:in `each_strongly_connected_component'
web_1 | from /usr/local/lib/ruby/2.3.0/tsort.rb:226:in `tsort_each'
web_1 | from /usr/local/lib/ruby/2.3.0/tsort.rb:205:in `tsort_each'
web_1 | from /usr/local/bundle/gems/railties-5.0.0.1/lib/rails/initializable.rb:54:in `run_initializers'
web_1 | from /usr/local/bundle/gems/railties-5.0.0.1/lib/rails/application.rb:352:in `initialize!'
web_1 | from /work_project/config/environment.rb:5:in `<top (required)>'
web_1 | from /work_project/config.ru:3:in `require_relative'
web_1 | from /work_project/config.ru:3:in `block in <main>'
web_1 | from /usr/local/bundle/gems/rack-2.0.1/lib/rack/builder.rb:55:in `instance_eval'
web_1 | from /usr/local/bundle/gems/rack-2.0.1/lib/rack/builder.rb:55:in `initialize'
web_1 | from /work_project/config.ru:in `new'
web_1 | from /work_project/config.ru:in `<main>'
web_1 | from /usr/local/bundle/gems/rack-2.0.1/lib/rack/builder.rb:49:in `eval'
web_1 | from /usr/local/bundle/gems/rack-2.0.1/lib/rack/builder.rb:49:in `new_from_string'
web_1 | from /usr/local/bundle/gems/rack-2.0.1/lib/rack/builder.rb:40:in `parse_file'
web_1 | from /usr/local/bundle/gems/rack-2.0.1/lib/rack/server.rb:318:in `build_app_and_options_from_config'
web_1 | from /usr/local/bundle/gems/rack-2.0.1/lib/rack/server.rb:218:in `app'
web_1 | from /usr/local/bundle/gems/railties-5.0.0.1/lib/rails/commands/server.rb:59:in `app'
web_1 | from /usr/local/bundle/gems/rack-2.0.1/lib/rack/server.rb:353:in `wrapped_app'
web_1 | from /usr/local/bundle/gems/railties-5.0.0.1/lib/rails/commands/server.rb:124:in `log_to_stdout'
web_1 | from /usr/local/bundle/gems/railties-5.0.0.1/lib/rails/commands/server.rb:77:in `start'
web_1 | from /usr/local/bundle/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:90:in `block in server'
web_1 | from /usr/local/bundle/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:85:in `tap'
web_1 | from /usr/local/bundle/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:85:in `server'
web_1 | from /usr/local/bundle/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
web_1 | from /usr/local/bundle/gems/railties-5.0.0.1/lib/rails/commands.rb:18:in `<top (required)>'
web_1 | from bin/rails:4:in `require'
web_1 | from bin/rails:4:in `<main>'
work_project_web_1 exited with code 1
My docker-compose file:
version: '2'
services:
db:
image: postgres:9.6.0
redis:
image: redis:3.2.4
command: redis-server
ports:
- '6379:6379'
volumes:
- '.:/var/lib/redis/data'
# To run jobs in development, uncomment out this block
sidekiq:
build: .
command: bundle exec sidekiq -C config/sidekiq.yml
env_file: .env
links:
- db
- redis
web:
build: .
command: bundle exec rails s -p 3000 -b '0.0.0.0'
env_file: .env
volumes:
- .:/work_project
ports:
- '3000:3000'
depends_on:
- db
- redis
Maybe a little overkill, but you could look at the Sidekiq Scheduler Gem. It offers a lot, like regular scheduling of jobs, but also includes an option to trigger on startup.
I have the problem that Foreman was running correctly until a few days ago. Yesterday I made a complete upgrade of the all system, so I don't know if this caused the problem.
Anyway I cannot trace the problem back.
To solve the problem I updated all my gems, uninstalled and re-installed the myslq2 gem, but nothing has changed.
I paste the Foreman output
luca#luca-X200MA:~/cmonrails/cmonrails$ foreman start
10:46:36 web.1 | started with pid 6863
10:46:36 memcached.1 | started with pid 6864
10:46:40 web.1 | warning: parser/current is loading parser/ruby21, which recognizes
10:46:40 web.1 | warning: 2.1.7-compliant syntax, but you are running 2.1.2.
10:46:40 web.1 | warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.
10:46:42 web.1 | => Booting WEBrick
10:46:42 web.1 | => Rails 4.2.3 application starting in development on http://0.0.0.0:3000
10:46:42 web.1 | => Run `rails server -h` for more startup options
10:46:42 web.1 | => Ctrl-C to shutdown server
10:46:42 web.1 | Exiting
10:46:42 web.1 | /var/lib/gems/2.1.0/gems/activerecord-4.2.3/lib/active_record/connection_adapters/connection_specification.rb:177:in `rescue in spec': Specified 'mysql2' for database adapter, but the gem is not loaded. Add `gem 'mysql2'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord). (Gem::LoadError)
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/activerecord-4.2.3/lib/active_record/connection_adapters/connection_specification.rb:174:in `spec'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/activerecord-4.2.3/lib/active_record/connection_handling.rb:50:in `establish_connection'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/activerecord-4.2.3/lib/active_record/railtie.rb:120:in `block (2 levels) in <class:Railtie>'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/activesupport-4.2.3/lib/active_support/lazy_load_hooks.rb:38:in `instance_eval'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/activesupport-4.2.3/lib/active_support/lazy_load_hooks.rb:38:in `execute_hook'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/activesupport-4.2.3/lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/activesupport-4.2.3/lib/active_support/lazy_load_hooks.rb:44:in `each'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/activesupport-4.2.3/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/activerecord-4.2.3/lib/active_record/base.rb:315:in `<module:ActiveRecord>'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/activerecord-4.2.3/lib/active_record/base.rb:26:in `<top (required)>'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/newrelic_rpm-3.14.0.305/lib/new_relic/environment_report.rb:73:in `block in <class:EnvironmentReport>'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/newrelic_rpm-3.14.0.305/lib/new_relic/environment_report.rb:99:in `call'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/newrelic_rpm-3.14.0.305/lib/new_relic/environment_report.rb:99:in `block in initialize'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/newrelic_rpm-3.14.0.305/lib/new_relic/environment_report.rb:97:in `each'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/newrelic_rpm-3.14.0.305/lib/new_relic/environment_report.rb:97:in `inject'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/newrelic_rpm-3.14.0.305/lib/new_relic/environment_report.rb:97:in `initialize'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/newrelic_rpm-3.14.0.305/lib/new_relic/agent/agent.rb:799:in `new'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/newrelic_rpm-3.14.0.305/lib/new_relic/agent/agent.rb:799:in `environment_for_connect'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/newrelic_rpm-3.14.0.305/lib/new_relic/agent/agent.rb:790:in `generate_environment_report'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/newrelic_rpm-3.14.0.305/lib/new_relic/agent/agent.rb:491:in `setup_and_start_agent'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/newrelic_rpm-3.14.0.305/lib/new_relic/agent/agent.rb:479:in `check_config_and_start_agent'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/newrelic_rpm-3.14.0.305/lib/new_relic/agent/agent.rb:547:in `start'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/newrelic_rpm-3.14.0.305/lib/new_relic/control/instance_methods.rb:112:in `start_agent'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/newrelic_rpm-3.14.0.305/lib/new_relic/control/instance_methods.rb:72:in `init_plugin'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/newrelic_rpm-3.14.0.305/lib/newrelic_rpm.rb:41:in `block in <class:Railtie>'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/railties-4.2.3/lib/rails/initializable.rb:30:in `instance_exec'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/railties-4.2.3/lib/rails/initializable.rb:30:in `run'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/railties-4.2.3/lib/rails/initializable.rb:55:in `block in run_initializers'
10:46:42 web.1 | from /usr/lib/ruby/2.1.0/tsort.rb:226:in `block in tsort_each'
10:46:42 web.1 | from /usr/lib/ruby/2.1.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
10:46:42 web.1 | from /usr/lib/ruby/2.1.0/tsort.rb:427:in `each_strongly_connected_component_from'
10:46:42 web.1 | from /usr/lib/ruby/2.1.0/tsort.rb:347:in `block in each_strongly_connected_component'
10:46:42 web.1 | from /usr/lib/ruby/2.1.0/tsort.rb:345:in `each'
10:46:42 web.1 | from /usr/lib/ruby/2.1.0/tsort.rb:345:in `call'
10:46:42 web.1 | from /usr/lib/ruby/2.1.0/tsort.rb:345:in `each_strongly_connected_component'
10:46:42 web.1 | from /usr/lib/ruby/2.1.0/tsort.rb:224:in `tsort_each'
10:46:42 web.1 | from /usr/lib/ruby/2.1.0/tsort.rb:205:in `tsort_each'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/railties-4.2.3/lib/rails/initializable.rb:54:in `run_initializers'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/railties-4.2.3/lib/rails/application.rb:352:in `initialize!'
10:46:42 web.1 | from /home/luca/cmonrails/cmonrails/config/environment.rb:5:in `<top (required)>'
10:46:42 web.1 | from /home/luca/cmonrails/cmonrails/config.ru:3:in `require'
10:46:42 web.1 | from /home/luca/cmonrails/cmonrails/config.ru:3:in `block in <main>'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `instance_eval'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `initialize'
10:46:42 web.1 | from /home/luca/cmonrails/cmonrails/config.ru:in `new'
10:46:42 web.1 | from /home/luca/cmonrails/cmonrails/config.ru:in `<main>'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in `eval'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in `new_from_string'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/rack-1.6.4/lib/rack/builder.rb:40:in `parse_file'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/rack-1.6.4/lib/rack/server.rb:299:in `build_app_and_options_from_config'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/rack-1.6.4/lib/rack/server.rb:208:in `app'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/railties-4.2.3/lib/rails/commands/server.rb:61:in `app'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/rack-1.6.4/lib/rack/server.rb:336:in `wrapped_app'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/railties-4.2.3/lib/rails/commands/server.rb:139:in `log_to_stdout'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/railties-4.2.3/lib/rails/commands/server.rb:78:in `start'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/railties-4.2.3/lib/rails/commands/commands_tasks.rb:80:in `block in server'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/railties-4.2.3/lib/rails/commands/commands_tasks.rb:75:in `tap'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/railties-4.2.3/lib/rails/commands/commands_tasks.rb:75:in `server'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/railties-4.2.3/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/railties-4.2.3/lib/rails/commands.rb:17:in `<top (required)>'
10:46:42 web.1 | from bin/rails:8:in `require'
10:46:42 web.1 | from bin/rails:8:in `<main>'
10:46:42 web.1 | exited with code 1
10:46:42 system | sending SIGTERM to all processes
10:46:42 memcached.1 | terminated by SIGTERM
I've seen this often - it seems there is an issues with the latest mysql2 gem. You should try specifying a version that previously worked. I've personally found 0.3.20 fixes the problem. So just update your Gemfile with:
gem 'mysql2', '0.3.20'
Hopefully that should fix it.
My only assumption is that there are some changes in the main mysql2 gem to support Rails 5?