我用devise做用户注册及登录当我点击登录时候出现下面错 NameError in Devise::SessionsController#create 网上找了下 有帖说要修改“可以通过修改 /config/initializers/cookie_verification_secret.rb中的secret key来修正” 但我在/config/initializers/找不到cookie_verification_secret.rb文件 我用的rails是3.1.3 在线求助
undefined local variable or method `root_path' for #<Devise::SessionsController:0x00000004574fc8>
Rails.root: /home/gsm/rails-work/devisedemo
Application Trace | Framework Trace | Full Trace
Request
Parameters:
{"utf8"=>"✓",
"authenticity_token"=>"X0kgzO8B2+AEMsffoKLcdTstYOaPDBvWmTAFGQXfRPQ=",
"user"=>{"email"=>"gsm1022@163.com",
"password"=>"[FILTERED]",
"remember_me"=>"0"},
"commit"=>"Sign in"}
Show session dump
_csrf_token: "X0kgzO8B2+AEMsffoKLcdTstYOaPDBvWmTAFGQXfRPQ="
flash: #<ActionDispatch::Flash::FlashHash:0x00000004cd1320 @used=#<Set: {}>, @closed=false, @flashes={:notice=>"Signed in successfully."}, @now=nil>
session_id: "f85426884953ea3639bcaa4d9ed10acb"
warden.user.user.key: ["User", [1], "$2a$10$.tmwyk7zABbzjP.sDA./6O"]
Show env dump
GATEWAY_INTERFACE: "CGI/1.1"
HTTP_ACCEPT: "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
HTTP_ACCEPT_CHARSET: "GBK,utf-8;q=0.7,*;q=0.3"
HTTP_ACCEPT_ENCODING: "gzip,deflate,sdch"
HTTP_ACCEPT_LANGUAGE: "zh-CN,zh;q=0.8"
HTTP_CACHE_CONTROL: "max-age=0"
REMOTE_ADDR: "127.0.0.1"
REMOTE_HOST: "localhost"
SERVER_NAME: "localhost"
SERVER_PROTOCOL: "HTTP/1.1"
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。