We’ve known plugins were being removed in Rails 4, and I’ve disagreed with the decision since I first saw the deprecation warning filling my console. To me, plugins live in a place between a single file library in /lib and gems. I can see why the Rails folks want to get rid of them, because having yet another thing to load at startup is a pain. But, for us and for a lot of our customers, they aren’t broken, so why fix them? And for us especially, it would be a pain to turn a couple dozen Moonshine plugins into gems when there are serious issues doing what Moonshine needs to do as a gem that aren’t a problem when it’s a plugin (was that vague enough?).
Ruby to the rescue! Introducing Plugger, the little gem that could. It does one thing and does it well enough that I shipped it. What does it do? It restores plugins in Rails 4! Yes, I know!
Since rails’ plugin action is still there, though severely broken, I created a new executable for plugger called… “plugger”. It’s basically Rails 3’s plugin action with some very minor changes.
All you need to do is add it to your Gemfile, bundle install, and your plugins should load under Rails 4. Now, it’s not going to magically make them compatible with Rails 4, but it will at least try to load your init.rb, generators and rake tasks.