I am deploying an app to heroku and the app is on rails 3.2 and I have active admin gem installed.
When I run rake db:migrate it fails due to the following error
== DeviseCreateAdminUsers: migrating =========================================
-- create_table(:admin_users)
-> 0.0823s
Sent mail to [email protected] (3228ms)
rake aborted!
An error has occurred, this and all later migrations canceled:
Connection refused - connect(2)
Wondering what I need to do to fix this. It seems that the Devise gem or ActiveAdmin needs to send mail during the migration process and because it can't if fails.
Try installing the Sendgrid addon:
heroku addons:add sendgrid:starter
If you are deploying to the Aspen or Bamboo stacks, it should work right away. If you are using the Cedar stack, you need to add an additional initializer:
#config/initializers/mail.rb
ActionMailer::Base.smtp_settings = {
:address => 'smtp.sendgrid.net',
:port => '587',
:authentication => :plain,
:user_name => ENV['SENDGRID_USERNAME'],
:password => ENV['SENDGRID_PASSWORD'],
:domain => 'heroku.com'
}
ActionMailer::Base.delivery_method = :smtp
Taken from: http://devcenter.heroku.com/articles/sendgrid
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With