Why are Railtie initializers not running?

When creating the Passenger-Monit plugin, I thought it was most advisable to use an initializer, i.e.

module PassengerMonit class Railtie < Rails::Railtie initializer "my_plugin.some_init_task" do # my initialization tasks end end end 

However, for some reason, the code in the block has never been executed. I finally talked to

 config.before_initialize {} 

but I am curious why the initializer was not executed. What could prevent him from working?

+7
source share
1 answer

In your gemfile you added

 gem "Passenger-Monit" 

Otherwise, you need to put it in your download path and require it in your application. http://www.igvita.com/2010/08/04/rails-3-internals-railtie-creating-plugins/

Good luck

+1
source

All Articles