“无法找到生成器oauth_consumer”运行“rails generate oauth_consumer”?

时间:2012-02-10 03:48:02

标签: ruby-on-rails ruby-on-rails-3 oauth generator oauth-2.0

我正在“无法找到生成器oauth_consumer”运行“rails generate oauth_consumer”???

好的,所以我是Rails 3的新手(刚回到它)。不知道我做错了什么。我试图遵循以下内容,但我猜测Rails 3已经改变了......

http://xaop.com/blog/2010/03/05/authentication-with-oauth-in-ruby-on-rails/

Gregs-MacBook-Pro:googleweekends greg$ ruby -v
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.3.0]

Gregs-MacBook-Pro:googleweekends greg$ rails -v
Rails 3.2.1

已将此添加到Gemfile:

    gem 'oauth'
    gem 'oauth-plugin'

运行“捆绑安装” - 不确定是否需要,因为我已经为oauth gem和插件单独完成了“gem install”。

Gregs-MacBook-Pro:googleweekends greg $ bundle install

...<cut>...
Using oauth (0.4.5)
Using oauth-plugin (0.3.14)
Using rails (3.2.1)
...<cut>...
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.

错误:

Gregs-MacBook-Pro:googleweekends greg$ rails generate oauth_consumer
Could not find generator oauth_consumer.

有什么建议吗?

1 个答案:

答案 0 :(得分:0)

ok - justed注意到一个gem插件版本的依赖 - 当我把它添加到我的GemFile时它起作用....

gem "oauth-plugin", ">= 0.4.0.pre1"

取自:

https://github.com/pelle/oauth-plugin