简体   繁体   English

SocketError:在运行Heroku时运行getokurinfo rake db:se在Heroku App-Rails4上的种子

[英]SocketError: getaddrinfo while running heroku run rake db:seed on a Heroku App-Rails4

I am using Rails4 and ruby2.0.0 . 我正在使用Rails4 and ruby2.0.0 I pushed my app on Heroku & I m getting this error when I run heroku run rake db:seed 我在Heroku上推送了我的应用程序,当我运行heroku run rake db:seed时遇到此错误

Running rake db:seed attached to terminal... up, run.6298 正在运行rake db:seed附加到终端...运行run.6298

Rendered devise/mailer/confirmation_instructions.html.erb (1.8ms) 呈现的devise / mailer / confirmation_instructions.html.erb(1.8ms)

Sent mail to xyz@gmail.com (29.3ms) rake aborted! 已将邮件发送到xyz@gmail.com(29.3ms),Rake已中止! SocketError: getaddrinfo: Temporary failure in name resolution /app/vendor/bundle/ruby/2.0.0/gems/mail-2.5.4/lib/mail/network/delivery_methods/smtp.rb:112:in deliver!' /app/vendor/bundle/ruby/2.0.0/gems/mail-2.5.4/lib/mail/message.rb:2129:in SocketError:getaddrinfo:名称解析/app/vendor/bundle/ruby/2.0.0/gems/mail-2.5.4/lib/mail/network/delivery_methods/smtp.rb:112: deliver!' /app/vendor/bundle/ruby/2.0.0/gems/mail-2.5.4/lib/mail/message.rb:2129:in暂时失败deliver!' /app/vendor/bundle/ruby/2.0.0/gems/mail-2.5.4/lib/mail/message.rb:2129:in deliver!' /app/vendor/bundle/ruby/2.0.0/gems/mail-2.5.4/lib/mail/message.rb:2129:in do_delivery' /app/vendor/bundle/ruby/2.0.0/gems/mail-2.5.4/lib/mail/message.rb:232:in block in deliver' /app/vendor/bundle/ruby/2.0.0/gems/actionmailer-4.0.1/lib/action_mailer/base.rb:456:in block in deliver_mail' /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/notifications.rb:159:in block in instrument' /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/notifications/instrumenter.rb:20:in instrument' /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/notifications.rb:159:in instrument' /app/vendor/bundle/ruby/2.0.0/gems/actionmailer-4.0.1/lib/action_mailer/base.rb:454:in deliver_mail' /app/vendor/bundle/ruby/2.0.0/gems/mail-2.5.4/lib/mail/message.rb:232:in deliver' /app/vendor/bundle/ruby/2.0.0/gems/devise-3.2.4/lib/devise/models/authenticatable.rb:173:in send_devise_notification' /app/vendor/bundle/ruby/2.0.0/gems/devise-3.2.4/lib/devise/m deliver!' /app/vendor/bundle/ruby/2.0.0/gems/mail-2.5.4/lib/mail/message.rb:2129:in do_delivery中/app/vendor/bundle/ruby/2.0.0/gems/mail -2.5.4 / lib / mail / message.rb:232: block in deliver' /app/vendor/bundle/ruby/2.0.0/gems/actionmailer-4.0.1/lib/action_mailer/base.rb:456:inblock in deliver' /app/vendor/bundle/ruby/2.0.0/gems/actionmailer-4.0.1/lib/action_mailer/base.rb:456:in delivery_mail' block in instrument' /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/notifications/instrumenter.rb:20:in 2.0.0 block in instrument' /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/notifications/instrumenter.rb:20:in gems block in instrument' /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/notifications/instrumenter.rb:20:in activesupport-4.0.1 block in instrument' /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/notifications/instrumenter.rb:20:in lib block in instrument' /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/notifications/instrumenter.rb:20:in active_support block in instrument' /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/notifications/instrumenter.rb:20:in notifications.rb:159中: block in instrument' /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/notifications/instrumenter.rb:20:in仪器中/app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib /active_support/notifications.rb:159:在instrument' /app/vendor/bundle/ruby/2.0.0/gems/actionmailer-4.0.1/lib/action_mailer/base.rb:454:in delivery_mail中/ app / vendor /bundle/ruby/2.0.0/gems/mail-2.5.4/lib/mail/message.rb:232:in delivery deliver' /app/vendor/bundle/ruby/2.0.0/gems/devise-3.2.4/lib/devise/models/authenticatable.rb:173:in send_devise_notification中/app/vendor/bundle/ruby/2.0.0/gems/devise-3.2.4/lib/devise/m odels/confirmable.rb:102:in send_confirmation_instructions' /app/vendor/bundle/ruby/2.0.0/gems/devise-3.2.4/lib/devise/models/confirmable.rb:158:in send_on_create_confirmation_instructions' /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/callbacks.rb:386:in _run__3822695918417406283__create__callbacks' /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/callbacks.rb:80:in run_callbacks' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/callbacks.rb:306:in create_record' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/timestamp.rb:57:in create_record' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/persistence.rb:477:in create_or_update' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/callbacks.rb:302:in block in create_or_update' /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/callbacks.rb:383:in _run__3822695918417406283__save__callbacks' /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/callbacks.rb:80:in odels / confirmable.rb:102:在send_confirmation_instructions' /app/vendor/bundle/ruby/2.0.0/gems/devise-3.2.4/lib/devise/models/confirmable.rb:158:in :在send_on_create_confirmation_instructions的/ app / vendor / bundle / ruby​​ / 2.0.0 / gems / activesupport-4.0.1 / lib / active_support / callbacks.rb:386:在_run__3822695918417406283__create__callbacks' /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/callbacks.rb:80:in run_callbacks中/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/callbacks.rb:306 _run__3822695918417406283__create__callbacks' /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/callbacks.rb:80:in create_record中create_record' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/timestamp.rb:57:in create_record' create_record' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/timestamp.rb:57:in 4.0.1 / lib / active_record / persistence.rb:477:在create_or_update' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/callbacks.rb:302:in :在块中在create_or_update'中/app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/callbacks.rb:383:在_run__3822695918417406283__save__callbacks' /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/callbacks.rb:80:in _run__3822695918417406283__save__callbacks' /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/callbacks.rb:80:in run_callbacks' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/callbacks.rb:302:in create_or_update' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/persistence.rb:106:in save' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/validations.rb:51:in save' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/attribute_methods/dirty.rb:32:in save' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/transactions.rb:270:in block (2 levels) in save' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/transactions.rb:326:in block in with_transaction_returning_status' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:202:in block in transaction' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:210:in _run__3822695918417406283__save__callbacks' /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/callbacks.rb:80:in __ _run__3822695918417406283__save__callbacks' /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/callbacks.rb:80:in run_callbacks'/app/ _run__3822695918417406283__save__callbacks' /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/callbacks.rb:80:in bundle/ _run__3822695918417406283__save__callbacks' /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/callbacks.rb:80:in 2.0.0/gems /activerecord-4.0.1/lib/active_record/callbacks.rb:302:在create_or_update' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/persistence.rb:106:in保存中/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/validations.rb:51 create_or_update' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/persistence.rb:106:in保存中save' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/attribute_methods/dirty.rb:32:in保存中/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/transactions .rb:270:在block (2 levels) in save' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/transactions.rb:326:in中的block (2 levels) in save' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/transactions.rb:326:in /vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/transactions.rb:326:在block (2 levels) in save' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/transactions.rb:326:in块中/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:202: block in transaction' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:210:in处于block in transaction' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:210:in block in transaction' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:210:in within_new_transaction' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:202:in transaction' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/transactions.rb:209:in transaction' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/transactions.rb:323:in with_transaction_returning_status' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/transactions.rb:270:in block in save' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/transactions.rb:281:in rollback_active_record_state!' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/transactions.rb:269:in block in transaction' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:210:in inside_new_transaction' block in transaction' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:210:in abstract / database_statements.rb:202: transaction' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/transactions.rb:209:in交易中/ app / vendor / bundle / ruby​​ / 2.0.0 / gems / activerecord-4.0.1 / lib / active_record / transactions.rb:323:in with_transaction_returning_status' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/transactions.rb:270:in /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/ with_transaction_returning_status' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/transactions.rb:270:in在保存块中/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/transactions.rb:281 with_transaction_returning_status' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/transactions.rb:270:in rollback_active_record_state!' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/transactions.rb:269:in rollback_active_record_state!' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/transactions.rb:269:in save' /app/db/seeds.rb:8:in <top (required)>' /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:223:in load' /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:223:in block in load' /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:214:in load_dependency' /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:223:in load' /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.1/lib/rails/engine.rb:540:in load_seed' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/tasks/database_tasks.rb:154:in load_seed' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/railties/databases.rake:181:in block (2 levels) in ' Tasks: TOP => db:seed (See full trace by running task with --trace) rollback_active_record_state!' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/transactions.rb:269:in save'/app/db/seeds.rb:8:in <top (required)>' /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:223:in vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb: <top (required)>' /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:223:in加载中'/app/vendor/bundle/ruby/2.0.0/ gems / activesupport-4.0.1 / lib / active_support / dependencies.rb:223: block in load' /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:214:in处于block in load' /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:214:in load_dependency中/app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:223 block in load' /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:214:in load' /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.1/lib/rails/engine.rb:540:in load_seed中/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/ task / database_tasks.rb:154:在load_seed' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/railties/databases.rake:181:in :在块中(2级)在“任务:TOP => db:seed中(通过使用--trace运行任务来查看完整跟踪)

You are creating devise users in your seed file. 您正在种子文件中创建devise用户。 Devise automatically sends some emails Eg email_confirmation. Devise自动发送一些电子邮件,例如email_confirmation。

So you have to set up a proper ActionMailer for production Environment. 因此,您必须为生产环境设置适当的ActionMailer。 You might be using an another heroku service for that. 您可能正在使用另一个heroku服务。 Eg mailgun 例如, 邮枪

You can also bypass devise email_confirmation in your seed file. 您还可以绕过种子文件中的设计email_confirmation

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM