bootsnap: Bundler 1.16.0 errors on Circle CI with load_path_cache
We started receiving errors on CirrleCI, I think they might have updated the docker image circleci/ruby:2.4-node-browsers to use newer bundler (1.15 => 1.16) or newer ruby version (2.4.1 => 2.4.2) or both.
This looks like a bug in bootsnap or bundler, because withtout bootsnap everything works ok.
It doesn’t work with bootsnap + bundler 1.16 + load_path_cache: true on CircleCI.
It works with bootsnap + bundler 1.16 + load_path_cache: false on CircleCI.
It works with bootsnap + bundler 1.15 + load_path_cache: true on CircleCI.
The problem might be bundler 1.16 + bootsnap, but I can’t reproduce this on OSX, only in CircleCI, haven’t tried this on other linux machines.
Any ideas how to fix or debug this?
The error when running rails c:
/usr/local/lib/ruby/site_ruby/2.4.0/bundler/runtime.rb:84:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'dotenv-rails'. (Bundler::GemRequireError)
Gem Load Error is: Trying to register Bundler::GemfileError for status code 4 but Bundler::GemfileError is already registered
Backtrace for gem load error is:
/usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/lib/bundler/errors.rb:9:in `status_code'
/usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/lib/bundler/errors.rb:20:in `<class:GemfileError>'
/usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/lib/bundler/errors.rb:20:in `<module:Bundler>'
/usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/lib/bundler/errors.rb:3:in `<main>'
/home/circleci/app/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.1.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:17:in `require'
/home/circleci/app/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.1.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:17:in `require'
Full log: https://gist.github.com/ebeigarts/3d4d2c03aec360fecd4132dd062a1589
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 7
- Comments: 17 (5 by maintainers)
Commits related to this issue
- Modify bootsnap config to work with circle ci This seems to be broken right now? https://github.com/Shopify/bootsnap/issues/103 — committed to edwardloveall/absalom-reckoning by edwardloveall 7 years ago
- Workaround to make bootsnap work with CircleCI There's a bug in bunbler or bootsnap or CircleCI. If you have bundler 1.16.0 and are using CircleCI with bootsnap, circle fails to find gems (I think). ... — committed to edwardloveall/absalom-reckoning by edwardloveall 7 years ago
I just worked around this by changing my boot.rb to the following:
Check checks for the
CIRCLECIenvironment variable and turns offload_path_cacheandautoload_paths_cachewhen using Circle.Great! I just released 1.2.0 so I’ll close.
Hi, I removed
require 'bootsnap/setup'fromboot.rband worked for me.This occurs for me locally with Rubygems 2.7.5. Downgrading to 2.7.4 fixes it:
gem update --system 2.7.4rvm all do gem update --system 2.7.4I experienced the same issue in a docker image and with 1.2.0.pre it works fine!! 👍
The above boot.rb did not work for me. I ended up using this and it works.
Just an FYI @wellington1993 … that removes Bootsnap from your application entirely, which is why you saw this work.
We haven’t been able to replicate this error at all, so it’s been difficult to look into. We just had someone replicate it locally so we should be able to look into what is happening here.
Sorry for the delay.
I was having this issue on CircleCI and 1.2.0.pre seems to have fixed it! 👍