0

更新: 我重新啓動了我的服務器之間的一些其他小的修復程序,我沒有得到錯誤。但是,我沒有收到確認電子郵件。另外,我可以通過點擊電子郵件驗證登錄。爲什麼我在註冊時在Devise上收到RunTimeError郵件確認?


試圖使用設計的電子郵件確認/驗證, 我正在從我的服務器下面,當我通過制定登入我的web應用程序:

RuntimeError in Devise/registrations#create 

    Missing host to link to! Please provide :host parameter or set default_url_options[:host] 
Extracted source (around line #5): 

2: 
3: <p>You can confirm your account through the link below:</p> 
4: 
5: <p><%= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @resource.confirmation_token) %></p> 

這很奇怪,因爲我有在我的development.rb文件中包含config.action_mailer.default_url_options = { :host => 'localhost:3000' },我處於開發模式。

感謝先進!

回答

0

您需要在ActionMailer配置中寫入域... 下面的代碼和平應該在developmen.rb文件中。 將域設置爲'localhost:3000',重新啓動服務器,然後立即登錄。

ActionMailer::Base.smtp_settings    = { 
     :address    => "smtp.gmail.com", 
     :port     => "587", 
     :domain    => "localhost:3000", 
     :enable_starttls_auto => true, 
     :authentication  => :login, 
     :user_name   => "<working email>@gmail.com", 
     :password    => "<password>" 
    } 
相關問題