I'm trying to use oauth-plugin
on a Rails
application I'm developing, but I keep running into problems.
To make sure I'm not making any mistake, I started an application from scratch (using Rails 3.0.3). Here are the steps I followed:
- Create da new rails application (
rails.test
) Edited its
Gemfile
to include:gem "oauth-plugin", ">=0.4.0.pre1" gem "oauth", "0.4.4"
Generated
oauth-consumer
, by runningscript/rails g oauth_consumer
Edited
oauth_consumers.rb
to include my keys for Google integration::google=>{ :key=>"anonymous", :secret=>"anonymous", :scope=>"https://www.google.com/calendar/feeds/", :options => { :site => "http://www.google.com", :request_token_path => "/accounts/OAuthGetRequestToken", :access_token_path => "/accounts/OAuthGetAccessToken", :authorize_path=> "/accounts/OAuthAuthorizeToken" }, }
Edited
routes.rb
to add the route foroauth_consumer
:resources :oauth_consumers
Edited
application_controller.rb
to implement thelogged_in?
method as follows:def logged_in? true end
Now when I access
http://localhost:3000/oauth_consumers/google
I get the following error:uninitialized constant GoogleToken
Does anyone know what causes this error and how can I fix it? GoogleToken
is a class that should have been auto generated by oauth-plugin
, so I can't tell why I'm getting this uninitialized constant error.