Detecting Rails Versions Easily and Quickly

While doing some routine maintenance on our server, I needed a quick way to check which actual versions of Rails I needed. Over time, many versions are installed that can lead to wasted space and confusion later on. So, I whipped up a quick one-liner that I can run to give me all versions of Rails running on our server.

This returns all Rails gem versions in a neat, sorted array:

Tags: ruby rails

Rails 2.3.0 and RouteSet#add_configuration_file

I’ve moved one of our projects over to edge rails after hearing about the new support for multiple routes files. I’ve been wanting this for a long time. It’s pretty easy to setup too:

First, make your custom routes file in config/

config/routes_custom.rb

Next, add an initializer to load that routes file on boot:

config/initializers/load_custom_routes.rb

If you clone from a master repo for custom projects, this is ideal as it won’t muck up the core routes file annoying you with conflicts and such.