bootsnap: Cannot define multiple 'included' blocks for a Concern
After seeing https://github.com/rails/rails/pull/29313 I wanted to give bootsnap a try, created a new rails 5.1.2 app on ruby 2.4.1 via rails new test_bootsnap. I added bootsnap to Gemfile and boot.rb like in the pull request and tried to start rails console via bundle exec rails c resulting in the following error:
$ bundle exec rails c
/Users/aqualon/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.2/lib/active_support/concern.rb:126:in `included': Cannot define multiple 'included' blocks for a Concern (ActiveSupport::Concern::MultipleIncludedBlocks)
from /Users/aqualon/.rvm/rubies/ruby-2.4.1/lib/ruby/gems/2.4.0/gems/actionview-5.1.2/lib/action_view/view_paths.rb:5:in `<module:ViewPaths>'
from /Users/aqualon/.rvm/rubies/ruby-2.4.1/lib/ruby/gems/2.4.0/gems/actionview-5.1.2/lib/action_view/view_paths.rb:2:in `<module:ActionView>'
from /Users/aqualon/.rvm/rubies/ruby-2.4.1/lib/ruby/gems/2.4.0/gems/actionview-5.1.2/lib/action_view/view_paths.rb:1:in `<main>'
from /Users/aqualon/.rvm/rubies/ruby-2.4.1/lib/ruby/gems/2.4.0/gems/bootsnap-1.1.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:17:in `require'
from /Users/aqualon/.rvm/rubies/ruby-2.4.1/lib/ruby/gems/2.4.0/gems/bootsnap-1.1.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:17:in `require'
from /Users/aqualon/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:292:in `block in require'
from /Users/aqualon/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:258:in `load_dependency'
from /Users/aqualon/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:292:in `require'
from /Users/aqualon/.rvm/gems/ruby-2.4.1/gems/actionview-5.1.2/lib/action_view/rendering.rb:1:in `<main>'
from /Users/aqualon/.rvm/rubies/ruby-2.4.1/lib/ruby/gems/2.4.0/gems/bootsnap-1.1.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:17:in `require'
from /Users/aqualon/.rvm/rubies/ruby-2.4.1/lib/ruby/gems/2.4.0/gems/bootsnap-1.1.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:17:in `require'
from /Users/aqualon/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:292:in `block in require'
from /Users/aqualon/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:258:in `load_dependency'
from /Users/aqualon/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:292:in `require'
from /Users/aqualon/.rvm/gems/ruby-2.4.1/gems/jbuilder-2.7.0/lib/jbuilder/railtie.rb:15:in `<module:ApiRendering>'
from /Users/aqualon/.rvm/gems/ruby-2.4.1/gems/jbuilder-2.7.0/lib/jbuilder/railtie.rb:14:in `<module:ActionController>'
from /Users/aqualon/.rvm/gems/ruby-2.4.1/gems/jbuilder-2.7.0/lib/jbuilder/railtie.rb:13:in `block in <class:Railtie>'
from /Users/aqualon/.rvm/gems/ruby-2.4.1/gems/railties-5.1.2/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/aqualon/.rvm/gems/ruby-2.4.1/gems/railties-5.1.2/lib/rails/initializable.rb:30:in `run'
from /Users/aqualon/.rvm/gems/ruby-2.4.1/gems/railties-5.1.2/lib/rails/initializable.rb:59:in `block in run_initializers'
from /Users/aqualon/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/tsort.rb:228:in `block in tsort_each'
from /Users/aqualon/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
from /Users/aqualon/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/tsort.rb:431:in `each_strongly_connected_component_from'
from /Users/aqualon/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/tsort.rb:349:in `block in each_strongly_connected_component'
from /Users/aqualon/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/tsort.rb:347:in `each'
from /Users/aqualon/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/tsort.rb:347:in `call'
from /Users/aqualon/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/tsort.rb:347:in `each_strongly_connected_component'
from /Users/aqualon/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/tsort.rb:226:in `tsort_each'
from /Users/aqualon/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/tsort.rb:205:in `tsort_each'
from /Users/aqualon/.rvm/gems/ruby-2.4.1/gems/railties-5.1.2/lib/rails/initializable.rb:58:in `run_initializers'
from /Users/aqualon/.rvm/gems/ruby-2.4.1/gems/railties-5.1.2/lib/rails/application.rb:353:in `initialize!'
from /Users/aqualon/Projects/test_bootsnap/config/environment.rb:5:in `<main>'
from /Users/aqualon/.rvm/rubies/ruby-2.4.1/lib/ruby/gems/2.4.0/gems/bootsnap-1.1.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:17:in `require'
from /Users/aqualon/.rvm/rubies/ruby-2.4.1/lib/ruby/gems/2.4.0/gems/bootsnap-1.1.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:17:in `require'
from /Users/aqualon/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:292:in `block in require'
from /Users/aqualon/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:258:in `load_dependency'
from /Users/aqualon/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:292:in `require'
from /Users/aqualon/.rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/application.rb:102:in `preload'
from /Users/aqualon/.rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/application.rb:153:in `serve'
from /Users/aqualon/.rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/application.rb:141:in `block in run'
from /Users/aqualon/.rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/application.rb:135:in `loop'
from /Users/aqualon/.rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/application.rb:135:in `run'
from /Users/aqualon/.rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/application/boot.rb:19:in `<top (required)>'
from /Users/aqualon/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/aqualon/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from -e:1:in `<main>'
If I remove bootsnap/setup from boot.rb, rails console starts fine.
System is macOS Sierra 10.12.6, ruby managed via rvm, bundler version 1.15.1.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 43 (11 by maintainers)
Commits related to this issue
- Disable Bootsnap completely until production issue is fixed. See: Shopify/bootsnap/issues/75 — committed to bluz71/platters by bluz71 7 years ago
- Use glibc version in ruby_platform cache header if available Previously, the `ruby_platform` header in the cache was calculated as a hash of the `RUBY_PLATFORM` (e.g. x86_64-linux-gnu) with the `unam... — committed to stanhu/bootsnap by stanhu 5 years ago
- Use glibc version in ruby_platform cache header if available Previously, the `ruby_platform` header in the cache was calculated as a hash of the `RUBY_PLATFORM` (e.g. x86_64-linux-gnu) with the `unam... — committed to stanhu/bootsnap by stanhu 5 years ago
- Use glibc version in ruby_platform cache header if available Previously, the `ruby_platform` header in the cache was calculated as a hash of the `RUBY_PLATFORM` (e.g. x86_64-linux-gnu) with the `unam... — committed to stanhu/bootsnap by stanhu 5 years ago
1.3.0 fixes an issue that looks similar to this. Can anyone confirm whether it does or does not solve the problem?
Can you please check if https://github.com/Shopify/bootsnap/pull/136 fixes the issue? You can try it with
gem 'bootsnap', github: 'ojab/bootsnap', require: falsein Gemfile.@burke It’s still happening after updating to version
1.1.5(now with Ruby 2.4.1 & Rails 5.1.4)@burke,
1.3.0works on my Digital Ocean box, previously I had Bootsnap failures.I had no success with Bootsnap from around
1.1.4through1.1.7. Coming back now after a hiatus to1.3.0and indeed it solves my issues.Thanks to you and the team, good job.
@burke looks like it’s working for me \o/
Getting the same error on production
Added to Gemfile bootsnap and required in boot.rb -> deploy -> it works next day Updated one gem to higher version -> deploy -> fails with this error