2016-10-13 5 views
1

Rails 4.2에서 5로 업그레이드 한 후 Devise가 작동하는 데 문제가 있습니다. Rails 4를 실행하면 모든 것이 매력처럼 작동하지만 게시 업데이트는 개발 및 프로덕션에서 전송되지 않습니다. 처음에는 모든 설정을 그대로 두었습니다. 한 번 문제에 대해 알고 있었지만 몇 가지 변경 사항을 작성했습니다.이 순간에 제가 가지고있는 것입니다 (이니셜 라이저를 대체 한 어떤 시점에서 devise 설치 프로그램을 다시 실행하십시오/devise.rb)Rails 5로 업그레이드 한 후 이메일을 보내지 않음.

development.rb

Rails.application.configure do 
    .. 
    config.action_mailer.raise_delivery_errors = true 
    config.action_mailer.delivery_method = :smtp 
    config.action_mailer.perform_deliveries = true 
    config.action_mailer.default :charset => "utf-8" 
    config.action_mailer.perform_caching = false 
    config.action_mailer.default_url_options = { host: 'localhost', port: 3000 } 
end 

초기화/devise.rb 나는 또한 유증 발행의 지시에 따라

# ==> Mailer Configuration 
    # Configure the e-mail address which will be shown in Devise::Mailer, 
    # note that it will be overwritten if you use your own mailer class 
    # with default "from" parameter. 
    config.mailer_sender = '[email protected]' 

    # Configure the class responsible to send e-mails. 
    config.mailer = 'Devise::Mailer' 

    # Configure the parent class responsible to send e-mails. 
    config.parent_mailer = 'ActionMailer::Base' 

(즉, 경로 등)

추가했다 유일한 전문을 연장 내가 ActionMailer 메시지를 전달하기 위해 활성 작업을 사용하고 있다는 점이다 따라서 send_devise_notification 오버라이드 (override) 내 사용자 모델이 추가 :

def send_devise_notification(notification, *args) 
    devise_mailer.send(notification, self, *args).deliver_later 
end 

찾는 것 콘솔 출력에서, 어떤 식 으로든 devise/mailer/confirmation_instructions.html.haml이 렌더링되고 있다고 제안하지 않습니다. 4.2.0, 루비 - - 루비 2.2.4p230 (2015년 12월 16일 개정 53155) [x86_64의 고안 :

DEBUG: Chewy strategies stack: [2] -> atomic @ /Users/georg/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/chewy-0.8.4/lib/chewy/railtie.rb:17 
Started POST "/en/users" for ::1 at 2016-10-13 14:05:41 +0200 
DEBUG: Chewy strategies stack: [2] <- atomic @ /Users/georg/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/chewy-0.8.4/lib/chewy/railtie.rb:17 
Processing by RegistrationsController#create as HTML 
    Parameters: {"utf8"=>"✓", "authenticity_token"=>"CZ0wqg4a/atdIYfZ/QOj3b/UsTl0oqkBrcZjS9ZF6vaJi4JSD3nO2EGcCVVaM+5QYTM7+Iw40q+zkxAWSDVj9A==", "user"=>{"country"=>"AF", "email"=>"[email protected]", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]", "tcagree"=>"1"}, "g-recaptcha-response"=>"", "commit"=>"Sign up for free!", "locale"=>"en"} 
    (0.3ms) BEGIN 
    User Exists (0.9ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = $1 LIMIT $2 [["email", "[email protected]"], ["LIMIT", 1]] 
    SQL (13.4ms) INSERT INTO "users" ("email", "encrypted_password", "confirmation_token", "confirmation_sent_at", "created_at", "updated_at", "roles_mask", "country") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["email", "[email protected]"], ["encrypted_password", "$2a$11$BzxtTw3PwaH06K6tpNlXHOtv.7sxgmVGhZyouIMzDfXP.cxnF2YGy"], ["confirmation_token", "Q-k8t3k-AmAoQoxggdcW"], ["confirmation_sent_at", 2016-10-13 12:05:42 UTC], ["created_at", 2016-10-13 12:05:42 UTC], ["updated_at", 2016-10-13 12:05:42 UTC], ["roles_mask", 64], ["country", "AF"]] 
    SQL (0.7ms) UPDATE "users" SET "id" = $1, "encrypted_password" = $2, "confirmation_token" = $3, "confirmation_sent_at" = $4, "created_at" = $5, "updated_at" = $6, "username" = $7, "roles_mask" = $8, "unconfirmed_email" = $9, "country" = $10 WHERE "users"."id" = $11 [["id", 16], ["encrypted_password", "$2a$11$BzxtTw3PwaH06K6tpNlXHOtv.7sxgmVGhZyouIMzDfXP.cxnF2YGy"], ["confirmation_token", "G3VSGdh-Q2C3sg1mxevB"], ["confirmation_sent_at", 2016-10-13 12:05:42 UTC], ["created_at", 2016-10-13 12:05:42 UTC], ["updated_at", 2016-10-13 12:05:42 UTC], ["username", "user-3aff9416"], ["roles_mask", 64], ["unconfirmed_email", "[email protected]"], ["country", "AF"], ["id", 16]] 
    (3.5ms) COMMIT 
Redirected to http://localhost:3000/ 
Completed 302 Found in 377ms (ActiveRecord: 18.8ms) 


DEBUG: Chewy strategies stack: [2] -> atomic @ /Users/georg/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/chewy-0.8.4/lib/chewy/railtie.rb:17 
Started GET "/" for ::1 at 2016-10-13 14:05:42 +0200 
DEBUG: Chewy strategies stack: [2] <- atomic @ /Users/georg/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/chewy-0.8.4/lib/chewy/railtie.rb:17 
Processing by StaticPagesController#redirect as HTML 
Redirected to http://localhost:3000/en 
Filter chain halted as :set_locale rendered or redirected 
Completed 302 Found in 14ms (ActiveRecord: 0.0ms) 


DEBUG: Chewy strategies stack: [2] -> atomic @ /Users/georg/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/chewy-0.8.4/lib/chewy/railtie.rb:17 
Started GET "/en" for ::1 at 2016-10-13 14:05:42 +0200 
DEBUG: Chewy strategies stack: [2] <- atomic @ /Users/georg/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/chewy-0.8.4/lib/chewy/railtie.rb:17 
Processing by StaticPagesController#welcome as HTML 
    Parameters: {"locale"=>"en"} 
    Rendering static_pages/welcome.html.haml within layouts/home 
    Rendered shared/_fb_image.html.haml (2.3ms) 
    Rendered static_pages/welcome.html.haml within layouts/home (13.4ms) 
    Rendered layouts/navs/_standard.html.haml (6.8ms) 
    Rendered layouts/_flashes.html.haml (3.0ms) 
    Rendered layouts/general/_shim.html.erb (0.9ms) 
    Rendered layouts/scripts/_google_analytics.html.haml (1.8ms) 
    Rendered layouts/_navbar.html.haml (2.6ms) 
    Rendered cookies_eu/_consent_banner.html.haml (1.8ms) 
    Rendered layouts/_footer.html.haml (2.8ms) 
    Rendered layouts/_base.html.haml (557.4ms) 
Completed 200 OK in 606ms (Views: 601.2ms | ActiveRecord: 0.0ms) 


DEBUG: Chewy strategies stack: [2] -> atomic @ /Users/georg/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/chewy-0.8.4/lib/chewy/railtie.rb:17 

모든 입력은 매우

내가 실행하고 최신 버전을 언급하는 것을 잊었다 주시면 감사하겠습니다 -darwin15], Rails-Rails 5.0.0

+0

내가 이미 로그인 한 것을 깨달을 때까지 나는 최근에 같은 문제에 봉착했습니다. 이 경우 전자 메일을 보내지 않았습니다. 로그인하지 않았는지 확인할 수 있습니까? 실제로 사용자가 이미 확인되었음을 의미합니다. – ck3g

+0

안녕하세요, 입력 해 주셔서 감사합니다. -하지만 이것은 불행히도 문제가 아닙니다. –

답변

0

모든 사용자 정의를 제거하고 처음부터 다시 작성한 후에도 가입 할 때 비밀번호를 재설정하고 메일러를 작성하기로 결정했습니다. 초대장 -보다 효과적이었습니다. 누군가가이 문제에 부딪 치고보다 단순하고 표준화 된 해결책을 찾아내는 경우 - 게시하십시오!

관련 문제