I’m converting Rails plugin to a gem and it has initializations in init.rb which used to run for plugin on plugin startup. But when I converted this plugin to gem this code no longer runs! What should I do to execute code on gem startup?
And initialization is Rails-specific, it require ::Rails.root
Using Railties initialization fixed and issue for me. init.rb was not run in appropriate time to have Rails.root configured.