pelle / oauth-plugin

Rails plugin for OAuth
http://stakeventures.com/articles/2009/07/21/consuming-oauth-intelligently-in-rails
MIT License
715 stars 215 forks source link

Rails 2.0.2 generate oauth_consumer gives errors #38

Open amnwebmaster opened 13 years ago

amnwebmaster commented 13 years ago

On Rails 2.0.2 & Ruby 1.8.7

running script/generate oauth_consumer give the error

/vendor/plugins/oauth-plugin/lib/oauth-plugin.rb:6: undefined method `version' for Rails:Module (NoMethodError)

Removing the rails 3 version check, running the script again then gives

/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:263:in load_missing_constant': uninitialized constant Rails::Railtie (NameError) vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:453:inconst_missing' from /u/apps/netadventist3/current/vendor/plugins/oauth-plugin/lib/oauth-plugin.rb:16

Unfortunately the app I'm extending has Rails 2.0.2 frozen in

Kimtaro commented 13 years ago

You need to add one extra condition for rails 3, not remove the check. I ran into the same problem and solved it with this patch: https://github.com/pelle/oauth-plugin/issues#issue/36

Cheers Kim