First, add this to your project's Gemfile:
bundle install to install it, and then add this to your project's
//= require state_machine
After that you're ready to roll. The upstream project's README is a good place to get started with some examples.