我对 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) Action 邮件 (3.0.1, 3.0.0) Action 包(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) build 者(2.1.2) bundler (1.0.3) 设计 (1.1.3) erubis (2.6.6) 法拉第 (0.4.6) gem_plugin (0.2.3) 混帐 (1.2.5) 国际化 (0.4.2, 0.4.1) 邮件(2.2.9、2.2.7) mime 类型 (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) omniauth (0.1.5, 0.1.4) 多语言 (0.3.1) pyu-ruby-sasl (0.0.3.2) 机架 (1.2.1) 机架安装 (0.6.13) 机架 openid (1.1.2) 机架测试(0.5.6) rails (3.0.1, 3.0.0) railties (3.0.1, 3.0.0) rake (0.8.7) 折扣 (1.6.5) 文档 (2.5.8) 休息客户端(1.6.1) ruby openid (2.1.8) ruby-openid-apps-discovery (1.2.0) ruby (0.1.1) sqlite3-ruby (1.3.1 x86-mingw32, 1.2.5 x86-mingw32) 雷神 (0.14.3) treetop (1.4.8) tzinfo (0.3.23) jail 长(0.10.7)
最佳答案
Restful 身份验证不再 100% 在 rails 3 中工作。它在 rails 3.x 中存在一些问题。尝试使用 Authlogic 或者事实上“devise”应该被证明是一个很好的身份验证系统,尤其是对于 Rails 3.x。我为我的应用程序使用 devise 并且它工作得很好!
关于ruby-on-rails - 我究竟如何在 rails 3 中安装 restful 身份验证插件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4038307/