bootsnap: `require': cannot load such file -- bootsnap/setup (LoadError)
I just followed the setup process mentioned in the README and got this error.
confit/boot.rb
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
require 'bundler/setup' # Set up gems listed in the Gemfile.
require 'bootsnap/setup'
Error stack
home/bhanu/workspace/truckola/config/boot.rb:4:in `require': cannot load such file -- bootsnap/setup (LoadError)
from /home/bhanu/workspace/truckola/config/boot.rb:4:in `<top (required)>'
from /home/bhanu/workspace/truckola/bin/rails:8:in `require_relative'
from /home/bhanu/workspace/truckola/bin/rails:8:in `<top (required)>'
from /home/bhanu/.rbenv/versions/2.3.1/gemsets/truckola/gems/spring-2.0.1/lib/spring/client/rails.rb:28:in `load'
from /home/bhanu/.rbenv/versions/2.3.1/gemsets/truckola/gems/spring-2.0.1/lib/spring/client/rails.rb:28:in `call'
from /home/bhanu/.rbenv/versions/2.3.1/gemsets/truckola/gems/spring-2.0.1/lib/spring/client/command.rb:7:in `call'
from /home/bhanu/.rbenv/versions/2.3.1/gemsets/truckola/gems/spring-2.0.1/lib/spring/client.rb:30:in `run'
from /home/bhanu/.rbenv/versions/2.3.1/gemsets/truckola/gems/spring-2.0.1/bin/spring:49:in `<top (required)>'
from /home/bhanu/.rbenv/versions/2.3.1/gemsets/truckola/gems/spring-2.0.1/lib/spring/binstub.rb:31:in `load'
from /home/bhanu/.rbenv/versions/2.3.1/gemsets/truckola/gems/spring-2.0.1/lib/spring/binstub.rb:31:in `<top (required)>'
from /home/bhanu/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from /home/bhanu/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from /home/bhanu/workspace/truckola/bin/spring:13:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 1
- Comments: 15 (3 by maintainers)
Links to this issue
Commits related to this issue
- DEFF-565 skip bootsnap -> https://github.com/Shopify/bootsnap/issues/73 — committed to deliveroo/roo_on_rails by deleted user 4 years ago
- [DEFF-565] replace calls to logger.with with just logger (#119) * DEFF-565 replace calls to logger.with with just logger * rubocop fixes * more rubocop fixes * DEFF-565 rubocop fixes * ru... — committed to deliveroo/roo_on_rails by deleted user 4 years ago
- bundle update bootsnap https://github.com/Shopify/bootsnap/issues/73 — committed to aiandrox/hashlog by aiandrox 3 years ago
- bundle update bootsnap https://github.com/Shopify/bootsnap/issues/73 — committed to aiandrox/hashlog by aiandrox 3 years ago
- bundle update bootsnap https://github.com/Shopify/bootsnap/issues/73 — committed to aiandrox/hashlog by aiandrox 3 years ago
I had a string of various
LoadErrorsand clearing the bootsnap cache finally cleared the load errors for me. Here’s how I did that:bootsnap-load-path-cacheandbootsnap-compile-cacheh/t #53
Not sure if deleting both the directory and the binary file there are necessary, perhaps you only have to clear one? Regardless, clearing it out got rid of load errors.
@nicolasmlv you are using
bootsnap (0.2.12)which did not include this file. We are now onbootsnap 1.1.2(After jumping from0.3.xwhich introducedbootsnap/setup).Please run
bundle update bootsnap😃Sorry I found the solution, I installed just the wrong rails version … Thank you all
ok it works, I think you can close the issue
rm -rf .bundle; bundle installsolved for meIt happened every I call
railson my project folder. Even right after I created fresh new project.rm -rf .bundle; bundle installdid not work on mine. Any ideas?ruby --version
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-darwin20]rails --version (this also give me those error, so I move to non rails project folder and excecute this)
Rails 7.0.4bootsnap
bootsnap-1.13.0In our case, we didn’t have wrong rails version installed and this still happened. Even removing
bundle installother bundle commands. Nothing helps it.because gems are okay and everything else is installed correctly.
Only way to get rid of random LoadErrors is deleting the files below IN THE APP. -app/tmp/cache/bootsnap-load-path-cache -app/tmp/cache/bootsnap-compile-cache
This still happens with the newest bootsnap 1.4.6. For some reason, it doesn’t clean up the load path cache after new gem installations or updates. I’m not sure the logic behind it.
@riyanpratamap I got almost the same issue with “require_relative”. Nothing helped, so I decided to update ruby-build
and rebuild the Ruby by rbenv.
and it helped.
I think this issue is connected to the Mac OS update (Ventura in my case)
how do i delete the files