Home > Software design >  Rails without actionmailbox and actionmailer
Rails without actionmailbox and actionmailer

Time:04-26

Is there a way to use Rails (7) without actionmailer and actionmailbox? I replaced the require "rails/all" with a small selection of gems I want to use. action_mailer/railtie and action_mailbox/engine is commented out. My Gemfile only contains the rails gem and some other unrelevant gems. But when I see the resulting Gemfile.lock after a bundle install, actionmailer and actionmailbox (and others) are still there:

enter image description here

Is there a way so exclude this from the resulting Gemfile.lock? I don't want this in my production deployment.

CodePudding user response:

The roadmap for such a feature does not look good https://github.com/wycats/bundler/issues/143.

Since you can use each of rails gems independently and they declare their own dependencies, declaring what you need in the Gemfile should be ok.

# Gemfile

# gem "rails", "~> 7.0.2.3"

rails_version = "~> 7.0.2.3"
gem "activesupport", rails_version
gem "actionpack",    rails_version
gem "actionview",    rails_version
gem "activemodel",   rails_version
gem "activerecord",  rails_version
# gem "actionmailer",  rails_version
gem "activejob",     rails_version
gem "actioncable",   rails_version
gem "activestorage", rails_version
# gem "actionmailbox", rails_version
gem "actiontext",    rails_version
gem "railties",      rails_version

# ...
  • Related