Using OmniAuth 0.3.0.rc1 with Rails 3.1

I’m posting this so others can avoid the frustration I felt yesterday trying to use OmniAuth in a Rails 3.1 application. After adding this to my Gemfile: gem "omniauth", :git => "git://github.com/intridea/omniauth.git"

and running: bundle install

I got this gem installed: * omniauth (1.0.0.alpha ba4bd3e)

When I tried running anything, however, such as rails generate . . . or rake spec, I’d get a stack trace complaining about: uninitialized constant OmniAuth::Builder

I googled and tried various things, coming to understand that I really wanted omniauth 0.3.0.rc1 but realizing I had no clue how to get it until I found this: http://collectiveidea.com/blog/archives/2010/09/28/gemfiles-and-branches/. So I added this to my Gemfile: gem "omniauth", ">= 0.3.0.rc1", :git => "git://github.com/intridea/omniauth.git", :branch => "0-3-stable"

and everything worked.

Tags: