Ruby thirdparties best practices

less than 1 minute read

I am just finishing migrating www.mes-courses.fr from rails 2 to rails 3, and I can assure that I learnt these lessons the hard way …

  • use Bundler http://gembundler.com
  • keep your Gemfile simple : just the top level dependencies, and no version constraints
  • try to stick to popular gems : you’ll find a lot more answers to your questions from the web. It’s often simpler to write and maintain a little extra code than to depend on a crappy thirdparty that is supposed to meet your need
  • stick with the most recent versions of your dependencies. With a good test suite and with Bundler, it should be rather easy to upgrade, so do it often to avoid both the upgrade tunnel effect and struggling with bugs and incompatibility of unmaintained old versions of gems.

Edit

I discovered the ruby toolbox that categorizes and sorts gems based on their popularity !

Edit 2

I discovered it is sometimes necessary to add constraints to get the latest versions of gems that would otherwise conflict (directly or not) with others.

I usually write about 15 minutes worth of reading per month. I won't transfer your email. No Spam, unsubscribe whenever you want.

As a gift for subscribing, you'll receive an illustrated mini-ebook "How to start a team coding dojo"!

Leave a comment