A small note in the “in case I need this again” category.
I’m writing a Sinatra app and want to add Twitter OAuth for signing in. A good way to do this appears to be with the omniauth
gem but I ran into an issue. require 'oa-oauth'
is the documented way to require the right gem, but the error I was getting was ‘require’: no such file to load — oa-oauth (LoadError), despite having installed the gem. I use RVM to control the Ruby environment, so also checked I’d installed the gem with the RVM version set to the version of Ruby I was using (1.9.2). Hunting around I found a partial answer on the issues list. Partial, because the answers there didn’t help, but the suggestion to try bundle show omniauth
did. Bundle came back with Could not find gem ‘omniauth’ in the current bundle.
The answer turned out to be to edit the Gemfile to add gem omniauth
to it, then running bundle install
. After that, bundle show omniauth
found the gem, and require 'oa-oauth'
in my Ruby app worked as well.