2014-09-23 125 views
0

我正在使用Rails4 and ruby2.0.0。我把我的應用程序上Heroku &當我運行我米得到這個錯誤的Heroku運行耙分貝:種子SocketError:getaddrinfo在運行時運行heroku運行rake db:在Heroku上運行Rails4種子

運行rake db:seed連接到終端...起來,run.6298

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

Sent mail to [email protected] (29.3ms) rake aborted! 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 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/models/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 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 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 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)

回答

1

你正在創建設計用戶在您的種子文件。設計自動發送一些電子郵件例如郵件確認。

因此,您必須爲生產環境設置適當的ActionMailer。您可能正在使用另一個heroku服務。例如mailgun

您也可以在您的種子文件中使用bypass devise email_confirmation

+0

謝謝,早些時候我試過在heroku控制檯上跳過email_confirmation,但是那時用戶沒有得到保存。如果你知道爲什麼heroku控制檯不保存用戶,那麼請告訴我。在種子文件中做同樣的工作。 – dips 2014-09-24 07:22:14