Is there a way to disable a railtie that is loaded by a gem by default ?
The developers of the gem did not make it modular and once putting the gem in the Gemfile, the require will automatically load the railties this way:
require 'some_gem'
module SomeGem
module RailtieMixin
extend ActiveSupport::Concern
included do
rake_tasks do
require 'some_gem/rake_tasks'
end
initializer 'some_gem.configuration' do
config.after_initialize do
...
end
end
initializer 'some_gem.controller_methods' do
...
end
end
end
end
I'd like to have some control, and ideally disable only the 'some_gem.controller_methods', is it possible to do this ? without monkeypatching ? without patching the gem ?
This doesn't exactly answer your question, but you can always use
in your Gemfile. This way, the gem won't be loaded and the initialization code won't run until you call
See: Bundler: What does :require => false in a Gemfile mean?