“method_missing”:未定义的局部变量或方法“authentication_keys”;安装设备时出错

发布于 2024-10-27 04:26:25 字数 1733 浏览 5 评论 0原文

我正在尝试让 Devise 启动并运行。我正在使用 devise 1.0.10 和rails 2.3.8,在一个非常干净的hostingrails 安装上。

当我运行 ruby​​ script/generate devise_install 时,

我收到以下错误消息。以前有人见过这个吗?有什么想法如何继续安装吗?我四处寻找,结果碰壁了。

谢谢,蒂姆

ruby​​ 脚本/生成 devise_install /home/p7017r10/appname/config/environment.rb:4:警告:已初始化常量 RAILS_ENV /usr/local/rvm/gems/ruby-1.8.6-p369/gems/activerecord-2.3.8/lib/active_record/base.rb:1994:in method_missing':未定义的局部变量或方法authentication_keys' for # (NameError) 来自 /usr/local/rvm/gems/ruby-1.8.6-p369/gems/devise-1.0.5/lib/devise/models/validatable.rb:18:in included' 来自 /usr/local/rvm/gems/ruby-1.8.6-p369/gems/devise-1.0.5/lib/devise/models/validatable.rb:16:inclass_eval' 来自 /usr/local/rvm/gems/ruby-1.8.6-p369/gems/devise-1.0.5/lib/devise/models/validatable.rb:16:in included' 来自 /usr/local/rvm/gems/ruby-1.8.6-p369/gems/devise-1.0.5/lib/devise/models.rb:66:ininclude' 来自 /usr/local/rvm/gems/ruby-1.8.6-p369/gems/devise-1.0.5/lib/devise/models.rb:66:in devise' 来自 /usr/local/rvm/gems/ruby-1.8.6-p369/gems/devise-1.0.5/lib/devise/models.rb:65:ineach' 来自 /usr/local/rvm/gems/ruby-1.8.6-p369/gems/devise-1.0.5/lib/devise/models.rb:65:in devise' 来自 /usr/local/rvm/gems/ruby-1.8.6-p369/gems/devise-1.0.5/lib/devise/orm/active_record.rb:24:inincluded_modules_hook' ... 37 个级别... 来自 /usr/local/rvm/gems/ruby-1.8.6-p369/gems/rails-2.3.8/lib/commands/generate.rb:1 来自 /usr/local/rvm/rubies/ruby-1.8.6-p369/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require' 来自 /usr/local/rvm/rubies/ruby-1.8.6-p369/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:inrequire' 来自脚本/生成:3

I'm trying to get Devise up and running. I'm using devise 1.0.10 and rails 2.3.8, on an otherwise pretty clean hostingrails install.

When I run ruby script/generate devise_install

I get the following error message. Has anyone seen this before. Any ideas how to proceed with the install? I searched around and hit a wall.

Thanks, Tim

ruby script/generate devise_install
/home/p7017r10/appname/config/environment.rb:4: warning: already initialized constant RAILS_ENV
/usr/local/rvm/gems/ruby-1.8.6-p369/gems/activerecord-2.3.8/lib/active_record/base.rb:1994:in method_missing': undefined local variable or methodauthentication_keys' for # (NameError)
from /usr/local/rvm/gems/ruby-1.8.6-p369/gems/devise-1.0.5/lib/devise/models/validatable.rb:18:in included'
from /usr/local/rvm/gems/ruby-1.8.6-p369/gems/devise-1.0.5/lib/devise/models/validatable.rb:16:in
class_eval'
from /usr/local/rvm/gems/ruby-1.8.6-p369/gems/devise-1.0.5/lib/devise/models/validatable.rb:16:in included'
from /usr/local/rvm/gems/ruby-1.8.6-p369/gems/devise-1.0.5/lib/devise/models.rb:66:in
include'
from /usr/local/rvm/gems/ruby-1.8.6-p369/gems/devise-1.0.5/lib/devise/models.rb:66:in devise'
from /usr/local/rvm/gems/ruby-1.8.6-p369/gems/devise-1.0.5/lib/devise/models.rb:65:in
each'
from /usr/local/rvm/gems/ruby-1.8.6-p369/gems/devise-1.0.5/lib/devise/models.rb:65:in devise'
from /usr/local/rvm/gems/ruby-1.8.6-p369/gems/devise-1.0.5/lib/devise/orm/active_record.rb:24:in
included_modules_hook'
... 37 levels...
from /usr/local/rvm/gems/ruby-1.8.6-p369/gems/rails-2.3.8/lib/commands/generate.rb:1
from /usr/local/rvm/rubies/ruby-1.8.6-p369/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require'
from /usr/local/rvm/rubies/ruby-1.8.6-p369/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
require'
from script/generate:3

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

十秒萌定你 2024-11-03 04:26:25

检查 Google 群组上的 devise 群组

http://groups.google.com/group/plataformatec-devise< /a>

这是提出这个问题的更好论坛

check the devise group on google groups

http://groups.google.com/group/plataformatec-devise

that's the better forum to ask this question

半仙 2024-11-03 04:26:25

我想你应该看看initializers/devise.rb。有一些关于设置这些键的说明。另外,请参阅http://asciicasts.com/episodes/210-customizing-devise, http://blog.plataformatec.com.br/tag/subdomain/

我没有将 devise 与 RoR 2.3.x 一起使用,仅与 3.0.x 一起使用。这可能就是区别。

希望有帮助。让我们知道:)

I guess you should look into initializers/devise.rb. There are some instructions on setting those keys. Plus, please refer to http://asciicasts.com/episodes/210-customizing-devise, http://blog.plataformatec.com.br/tag/subdomain/.

I didn't use devise with RoR 2.3.x, only with 3.0.x. That could be the difference.

Hope that helps. Let us know :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文