I am building a web application using Ruby on Rails. I use Mailgun as my mail program for this application. when I sign up with Facebook, it works fine, but when I try to sign in with email and password, I keep getting this error. "554 Please activate your Mailgun account. Check your inbox or log in to your control panel, to send an activation email. " I already allowed eamil to authorized recipients in the mailgun control panel. Here is my code:
Registrations_controller.rb
class RegistrationsController < Devise::RegistrationsController
protected
def update_resource(resource,params)
resource.update_without_password(params)
end
end
<strong> configurations / environment / development.rb
Rails.application.configure do
config.cache_classes = false
config.eager_load = false
config.consider_all_requests_local = true
if Rails.root.join('tmp/caching-dev.txt').exist?
config.action_controller.perform_caching = true
config.cache_store = :memory_store
config.public_file_server.headers = {
'Cache-Control' => 'public, max-age=172800'
}
else
config.action_controller.perform_caching = false
config.cache_store = :null_store
end
config.action_mailer.raise_delivery_errors = true
config.action_mailer.perform_caching = false
config.active_support.deprecation = :log
config.active_record.migration_error = :page_load
config.assets.debug = true
config.assets.quiet = true
config.file_watcher = ActiveSupport::EventedFileUpdateChecker
config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
address: 'smtp.mailgun.org',
port: 587,
domain: 'sandboxc77c3a9be90a494081dad1628d554337.mailgun.org',
authentication: 'plain',
user_name: 'postmaster@sandboxc77c3a9be90a494081dad1628d554337.mailgun.org',
password: 'password'
}
end
initalizers / devise.rb
Devise.setup do |config|
config.mailer_sender = 'reply@sandboxc77c3a9be90a494081dad1628d554337.mailgun.org'
require 'devise/orm/active_record'
config.case_insensitive_keys = [:email]
config.strip_whitespace_keys = [:email]
config.skip_session_storage = [:http_auth]
config.stretches = Rails.env.test? ? 1 : 11
config.reconfirmable = false
config.expire_all_remember_me_on_sign_out = true
config.password_length = 6..128
config.email_regexp = /\A[^@\s]+@[^@\s]+\z/
config.reset_password_within = 6.hours
config.sign_out_via = :delete
config.omniauth :facebook , '1811726395785808' , '2fcf2b0c1a2232b2e0850f35706bebcd' , scope: 'email', info_fields:'email,name'
end
opinions / invent / registration / new.html.erb
<div class="row">
<div class="col-md-4 col-md-offset-4">
<h2>Sign up</h2>
<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
<%= render 'layouts/shared/devisemes' %>
<div class="form-group">
<%= f.text_field :fullname, autofocus: true , placeholder: "Full Name" , class: "form-control" %>
</div>
<div class="form-group">
<%= f.email_field :email, autofocus: true , placeholder: "Email" , class: "form-control" %>
</div>
<div class="form-group">
<%= f.label :password %>
<% if @minimum_password_length %>
<em>(<%= @minimum_password_length %> characters minimum)</em>
<% end %><br />
<%= f.password_field :password, autocomplete: "off" , placeholder: "Password" , class: "form-control" %>
</div>
<div class="actions">
<%= f.submit "Sign up" , class: "btn btn-normal btn-block" %>
</div>
<% end %>
<%= link_to "Sign up with Facebook", user_facebook_omniauth_authorize_path , class: "btn btn-facebook btn-block"%>
<%= render "devise/shared/links" %>
</div>
</div>
Recipient authorized screenshot

The message displayed on the terminal
when I checked the logs in the terminal, I received this message that sends the letter correctly. However, it does not appear in my inbox, even if the email syntax appears in the terminal. this is a terminal log form
Rendering devise/mailer/confirmation_instructions.html.erb
Rendered devise/mailer/confirmation_instructions.html.erb (0.8ms)
Devise::Mailer#confirmation_instructions: processed outbound mail in 17.6ms
Sent mail to acoder888@gmail.com (6432.1ms)
Date: Mon, 06 Nov 2017 10:56:18 +0300
From: reply@sandboxc77c3a9be90a494081dad1628d554337.mailgun.org
Reply-To: reply@sandboxc77c3a9be90a494081dad1628d554337.mailgun.org
To: acoder888@gmail.com
Message-ID: <5a0015a210be9_6da3fd66d52e508105ae@Ahmeds-MacBook-Pro.local.mail>
Subject: Confirmation instructions
Mime-Version: 1.0
Content-Type: text/html;
charset=UTF-8
Content-Transfer-Encoding: 7bit
<p>Welcome acoder888@gmail.com!</p>
<p>You can confirm your account email through the link below:</p>
<p><a href="http://localhost:3000/confirmation?confirmation_token=_vmddjdeidjfjkdl">Confirm my account</a></p>
Completed 500 Internal Server Error in 6454ms (ActiveRecord: 0.3ms)
Net::SMTPFatalError (554 Please activate your Mailgun account. Check your inbox or log in to your control panel to resend the activation email.
):