(New to Rails) rails server error: cannot load such file -- bootsnap/setup (LoadError)
You have an issue with the gem bootsnap
which main job is to accelerate rails startup time.
So, you should either :
- In case you want
bootsnap
, addgem 'bootsnap'
to your gemfile to install it. - In case you don't want
bootsnap
, remove the linerequire 'bootsnap/setup'
inconfig/boot.rb
More info about bootsnap
: https://github.com/Shopify/bootsnap#how-does-this-work
Can't start brand new rails app on Heroku
Found a solution, In Gemfile.lock
I switched RUBY VERSION
to ruby 2.6.6p146
and BUNDLED WITH
to 1.17.3
Rails 7 Ruby 3.1 LoadError: cannot load such file -- net/smtp
For Rails 6
Add gem 'net-smtp', require: false
to your Gemfile and run bundle
.
Similarly I assume you may have problems with net-imap
and net-pop
and so have to add them until a new mail
gem version is released.
gem 'net-smtp', require: false
gem 'net-imap', require: false
gem 'net-pop', require: false
For Rails 7
On January 6th, 2022 Rails 7.0.1 was released:
The focus of this release is bring support to Ruby 3.1
Amongh other Ruby 3.1-related issues it brought a fix for this problem. So upgrade to Rails >= 7.0.1.
Related pull requests and issues:
- mikel/mail: Add former default gems as a dependency for Ruby 3.1 compatibility
- Add net/smtp gem for bug report templates to support Ruby 3.1
Related Topics
Undefined Method Respond_To in Rails 5 Controller
Install Ruby 2.2 on MAC Osx Catalina with Ruby-Install
How to Quickly Reorder a Ruby Array Given an Order
How to Use Us-Style Dates in Rails Using Ruby 1.9
2 Gems Need Different Versions of the Same Dependency
Gem Which Cannot Find Gem Despite It Being Installed
Error - "Gem Install Rails" - Libxml2 Is Missing
Why Require Mongo Gives Me Loaderror: No Such File to Load -- Openssl
Passing Params to Cancan in Ror
Use Delayed::Job to Manage Multiple Job Queues
Create a Tempfile Without Opening It in Ruby
Get All Variables Defined Through 'Attr_Accessor' Without Overriding 'Attr_Accessor'
Custom Filtering of Parameters in Rails 3 Using Config.Filter_Parameters