“method_missing”:未定义的局部变量或方法“authentication_keys”;安装设备时出错
我正在尝试让 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:in
class_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:in
include' 来自 /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:in
each' 来自 /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:in
included_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:in
require' 来自脚本/生成: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 method
authentication_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'
class_eval'
from /usr/local/rvm/gems/ruby-1.8.6-p369/gems/devise-1.0.5/lib/devise/models/validatable.rb:16:in
from /usr/local/rvm/gems/ruby-1.8.6-p369/gems/devise-1.0.5/lib/devise/models/validatable.rb:16:in included'
include'
from /usr/local/rvm/gems/ruby-1.8.6-p369/gems/devise-1.0.5/lib/devise/models.rb:66:in
from /usr/local/rvm/gems/ruby-1.8.6-p369/gems/devise-1.0.5/lib/devise/models.rb:66:in devise'
each'
from /usr/local/rvm/gems/ruby-1.8.6-p369/gems/devise-1.0.5/lib/devise/models.rb:65:in
from /usr/local/rvm/gems/ruby-1.8.6-p369/gems/devise-1.0.5/lib/devise/models.rb:65:in devise'
included_modules_hook'
from /usr/local/rvm/gems/ruby-1.8.6-p369/gems/devise-1.0.5/lib/devise/orm/active_record.rb:24:in
... 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'
require'
from /usr/local/rvm/rubies/ruby-1.8.6-p369/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
from script/generate:3
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
检查 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
我想你应该看看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 :)