I use semantic versioning to keep up with my Rails project releases. This involves tagging each release with a semantic version number preceeded by a 'v'.

For deployment I usually use Capistrano. The latest semantic version release as defined in the tags should be the version which is deployed in production. Here is how I accomplish this in my deployment.

<%= gist "ryanburnette", "bb34c4fa0fc2a70f91e8" %>

I'm setting branch to the latest tag by putting the tags into an array and using Gem to provide comparison for the sort method. The Gem trick is necessary because v1.0.10 is later than v1.0.9, but default sorting methods won't treat semantic versions as the spec defines them.