【问题标题】:How exactly do I install restful authentication plugin in rails 3?我究竟如何在 rails 3 中安装 restful 身份验证插件?
【发布时间】:2011-05-01 14:22:54
【问题描述】:

我对 rails 3 上的这个 restful 身份验证插件感到非常困惑。我尝试使用以下命令安装插件。它告诉我它已经安装了,然后我尝试使用--force 重新安装此插件它告诉我找不到该插件

如果插件已经安装,为什么当我尝试运行命令rails g authenticated user sessions --include-activation时会收到错误Could not find generator authenticated

有什么想法吗?

C:\Users\Jonathan\Documents\blog>rails plugin install http://github.com
/technoweenie/restful-authentication.git restful_authentication
already installed: restful-authentication (http://github.com/technoweenie/restfu
l-authentication.git).  pass --force to reinstall
already installed: restful_authentication (restful_authentication).  pass --forc
e to reinstall

C:\Users\Jonathan\Documents\blog>rails plugin install http://github.com
/technoweenie/restful-authentication.git restful_authentication --force
Plugin not found: ["http://github.com/technoweenie/restful-authentication.git",
"restful_authentication"]

C:\Users\Jonathan\Documents\blog>rails g authenticated user sessions --
include-activation
Could not find generator authenticated.

更新:这是运行gem list后的输出

抽象 (1.0.0) actionmailer (3.0.1, 3.0.0) 动作包(3.0.1、3.0.0) 活动模型(3.0.1、3.0.0) 活动记录(3.0.1、3.0.0) 活动资​​源(3.0.1、3.0.0) 主动支持(3.0.1、3.0.0) 可寻址 (2.2.2) 雷尔 (1.0.1) bcrypt-ruby (2.1.2) 建设者(2.1.2) 捆绑器 (1.0.3) 设计(1.1.3) 厄鲁比斯 (2.6.6) 法拉第 (0.4.6) gem_plugin (0.2.3) 混帐(1.2.5) i18n (0.4.2, 0.4.1) 邮件(2.2.9、2.2.7) 哑剧类型 (1.16) 迷你测试(1.6.0) 杂种 (1.2.0.pre2 x86-mingw32) multi_json (0.0.4) 网络 ldap (0.1.1) 漂亮的发电机 (0.4.2, 0.4.1) nokogiri (1.4.3.1 x86-mingw32) oa 基础版 (0.1.5, 0.1.4) oa 核心 (0.1.5, 0.1.4) oa-企业 (0.1.5, 0.1.4) oa-oauth (0.1.5, 0.1.4) oa-openid (0.1.5, 0.1.4) oauth (0.4.3) oauth2 (0.0.13) 全域认证(0.1.5,0.1.4) 多语言 (0.3.1) pyu-ruby-sasl (0.0.3.2) 机架 (1.2.1) 机架式 (0.6.13) 机架开放标识 (1.1.2) 机架测试(0.5.6) 导轨(3.0.1、3.0.0) 铁轨(3.0.1、3.0.0) 耙子 (0.8.7) rdiscount (1.6.5) rdoc (2.5.8) 休息客户端(1.6.1) 红宝石-openid (2.1.8) ruby-openid-apps-discovery (1.2.0) 红宝石 (0.1.1) sqlite3-ruby (1.3.1 x86-mingw32, 1.2.5 x86-mingw32) 雷神 (0.14.3) 树顶 (1.4.8) tzinfo (0.3.23) 典狱长 (0.10.7)

【问题讨论】:

  • 运行此命令并将输出显示给我们。 gem list
  • 如果您使用的是 rails 3,您应该使用 bundler,因为它是管理 gems 的方式。不应该做 gem install 除非它不是像应用程序这样的轨道
  • 感谢@sam 我更新了我的 gem 列表文件

标签: ruby-on-rails ruby-on-rails-3 ruby-on-rails-plugins restful-authentication


【解决方案1】:

Restful 身份验证不再 100% 在 Rails 3 中工作。它在 Rails 3.x 中存在一些问题。尝试使用 Authlogic 或者实际上“设计”应该被证明是一个很棒的身份验证系统,特别是对于 Rails 3.x。我在我的应用程序中使用设计,它工作得很好!!!

【讨论】:

    【解决方案2】:

    您可以使用 gem "rails3-restful-authentication", "~> 3.0.1" 来支持 rails 3。我已经做了一些补丁来使它与 rails 3 一起工作

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-09-19
    • 2010-12-14
    • 2010-10-12
    • 2019-03-09
    • 2011-01-10
    相关资源
    最近更新 更多