(New to Rails) Rails Server Error: Cannot Load Such File -- Bootsnap/Setup (Loaderror)

(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, add gem 'bootsnap' to your gemfile to install it.
  • In case you don't want bootsnap, remove the line require 'bootsnap/setup' in config/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



Leave a reply



Submit