我想为我的网站创建用户身份验证功能(使用rails),所以采用gem'depaise'。但是在设置设计时遇到了麻烦。
我尝试了这些命令。
rails g devise:install
rails g devise User
并迁移我的数据库,设置路线。
根据互联网上的一些文章,这些只有2个命令给我认证功能。
当然,我实施了sign_up和sign_out。 但是,当我去sign_in页面时,出了点问题。 我写下面的情况。
在'4'中,我希望重定向到根页。
请告诉我如何解决它。
虽然我删除或注释掉了可能会干扰的文件或代码,但我尝试了很多次,但我无法做到。
LOG在这里:
web_1 | 07:43:23 app.1 | Started POST "/users/sign_in" for 172.18.0.1 at 2018-02-01 07:43:23 +0000
web_1 | 07:43:23 app.1 | Cannot render console from 172.18.0.1! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
web_1 | 07:43:23 app.1 | Processing by Devise::SessionsController#create as HTML
web_1 | 07:43:23 app.1 | Parameters: {"utf8"=>"✓", "authenticity_token"=>"EUXiO3ma/Bv10PgTUuzdkokJtHJAbcgAOOhjBGAOyTJXx4cExBzqiKpg8imib7M9PU/wNXvyIgQwJOqjGEFYxA==", "user"=>{"email"=>"user1@gmail.com", "password"=>"[FILTERED]", "remember_me"=>"0"}, "commit"=>"Log in"}
web_1 | 07:43:23 app.1 | User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."email" = $1 ORDER BY "users"."id" ASC LIMIT $2 [["email", "user1@gmail.com"], ["LIMIT", 1]]
web_1 | 07:43:24 app.1 | (0.3ms) BEGIN
web_1 | 07:43:24 app.1 | (0.2ms) ROLLBACK
web_1 | 07:43:24 app.1 | Rendering vendor/bundle/ruby/2.4.0/gems/devise-4.4.0/app/views/devise/sessions/new.html.erb within layouts/application
web_1 | 07:43:24 app.1 | Rendered vendor/bundle/ruby/2.4.0/gems/devise-4.4.0/app/views/devise/shared/_links.html.erb (0.7ms)
web_1 | 07:43:24 app.1 | Rendered vendor/bundle/ruby/2.4.0/gems/devise-4.4.0/app/views/devise/sessions/new.html.erb within layouts/application (3.5ms)
web_1 | 07:43:24 app.1 | Rendered layouts/_header.html.slim (3.2ms)
web_1 | 07:43:24 app.1 | Completed 200 OK in 156ms (Views: 26.5ms | ActiveRecord: 0.9ms)