1

寻求有关 Rails 中动作邮件的帮助。我正在使用 Rails 3.2 并设计用于身份验证。我按照 railscasts 开始使用动作邮件程序,所以我第一次设置动作邮件程序并遇到了一些问题。我已将设计的注册控制器设置为在注册时发送电子邮件。发生的事情是应用程序在遇到该行代码以发送电子邮件时发生故障。我在下面包括我的日志、操作邮件等以寻求帮助....感谢您的帮助

开发日志

Started POST "/accounts" for 127.0.0.1 at 2012-08-04 15:36:11 -0600
Processing by RegistrationsController#create as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"EWH87yAT4dTuK12kZ27HiidVzGZAhx+sHa4N2rXIWIM=", "user"=>{"firstname"=>"john", "lastname"=>"doe", "email"=>"[FILTERED]", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}, "store"=>{"storename"=>"Store 1"}, "commit"=>"Create my Account"}
  [1m[36m (0.1ms)[0m  [1mBEGIN[0m
  [1m[35m (0.0ms)[0m  COMMIT
  [1m[36m (0.0ms)[0m  [1mBEGIN[0m
  [1m[35mUser Exists (0.5ms)[0m  SELECT 1 FROM `users` WHERE `users`.`email` = BINARY 'david.gilbert@visibleequity.com' LIMIT 1
  [1m[36mSQL (0.3ms)[0m  [1mINSERT INTO `users` (`admin`, `created_at`, `current_sign_in_at`, `current_sign_in_ip`, `email`, `encrypted_password`, `firstname`, `last_sign_in_at`, `last_sign_in_ip`, `lastname`, `owner`, `remember_created_at`, `rentor`, `reset_password_sent_at`, `reset_password_token`, `sign_in_count`, `updated_at`, `userimage`) VALUES (0, '2012-08-04 21:36:11', NULL, NULL, '[FILTERED]', '$2a$10$yXNkAXglLgZBBPkDmE/T2uShDtgXeRO3ka1mXhUxwzTABgp.8Ijle', 'john', NULL, NULL, 'doe', 0, NULL, 1, NULL, NULL, 0, '2012-08-04 21:36:11', NULL)[0m
  [1m[35mSQL (0.2ms)[0m  INSERT INTO `stores` (`created_at`, `storeimage`, `storename`, `updated_at`, `user_id`) VALUES ('2012-08-04 21:36:11', NULL, 'Store 1', '2012-08-04 21:36:11', 118)
  [1m[36m (0.5ms)[0m  [1mCOMMIT[0m
  Rendered user_mailer/signup_confirmation.text.erb (0.4ms)

服务器日志

Served asset /head_transpar.png - 304 Not Modified (0ms)
/Users/dave/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/smtp.rb:583: [BUG] Segmentation fault
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.2.0]

-- Control frame information -----------------------------------------------
c:0107 p:---- s:0530 b:0530 l:000529 d:000529 CFUNC  :connect
c:0106 p:0059 s:0527 b:0527 l:000526 d:000526 METHOD /Users/dave/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/smtp.rb:583
c:0105 p:0255 s:0522 b:0521 l:000b70 d:000b70 METHOD /Users/dave/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/smtp.rb:560
c:0104 p:0047 s:0513 b:0513 l:000512 d:000512 METHOD /Users/dave/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/smtp.rb:519
c:0103 p:0668 s:0506 b:0506 l:000505 d:000505 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/mail-2.4.4/lib/mail/network/delivery_methods/smtp.rb:144
c:0102 p:0031 s:0495 b:0495 l:000494 d:000494 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/mail-2.4.4/lib/mail/message.rb:2034
c:0101 p:0009 s:0491 b:0491 l:000467 d:000490 BLOCK  /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/mail-2.4.4/lib/mail/message.rb:229
c:0100 p:0021 s:0489 b:0489 l:000471 d:000488 BLOCK  /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/actionmailer-3.2.0/lib/action_mailer/base.rb:414
c:0099 p:0017 s:0486 b:0486 l:000476 d:000485 BLOCK  /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0/lib/active_support/notifications.rb:123
c:0098 p:0032 s:0484 b:0484 l:000483 d:000483 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0/lib/active_support/notifications/instrumenter.rb:20
c:0097 p:0036 s:0477 b:0477 l:000476 d:000476 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0/lib/active_support/notifications.rb:123
c:0096 p:0021 s:0472 b:0472 l:000471 d:000471 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/actionmailer-3.2.0/lib/action_mailer/base.rb:412
c:0095 p:0039 s:0468 b:0468 l:000467 d:000467 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/mail-2.4.4/lib/mail/message.rb:229
c:0094 p:0091 s:0465 b:0465 l:000464 d:000464 METHOD /Users/dave/rails_projects/EquiptMe/app/controllers/registrations_controller.rb:6
c:0093 p:0014 s:0462 b:0462 l:000461 d:000461 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/action_controller/metal/implicit_render.rb:4
c:0092 p:0015 s:0456 b:0456 l:000455 d:000455 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/abstract_controller/base.rb:167
c:0091 p:0041 s:0451 b:0451 l:000450 d:000450 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/action_controller/metal/rendering.rb:10
c:0090 p:0010 s:0447 b:0447 l:001a20 d:000446 BLOCK  /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/abstract_controller/callbacks.rb:18
c:0089 p:0192 s:0445 b:0445 l:000444 d:000444 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:436
c:0088 p:0112 s:0439 b:0439 l:000438 d:000438 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:405
c:0087 p:0027 s:0430 b:0430 l:000429 d:000429 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:385
c:0086 p:0024 s:0425 b:0425 l:000424 d:000424 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:81
c:0085 p:0020 s:0419 b:0419 l:001a20 d:001a20 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/abstract_controller/callbacks.rb:17
c:0084 p:0012 s:0415 b:0415 l:000414 d:000414 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/action_controller/metal/rescue.rb:29
c:0083 p:0010 s:0410 b:0410 l:000391 d:000409 BLOCK  /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/action_controller/metal/instrumentation.rb:30
c:0082 p:0017 s:0406 b:0406 l:000396 d:000405 BLOCK  /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0/lib/active_support/notifications.rb:123
c:0081 p:0032 s:0404 b:0404 l:000403 d:000403 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0/lib/active_support/notifications/instrumenter.rb:20
c:0080 p:0036 s:0397 b:0397 l:000396 d:000396 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0/lib/active_support/notifications.rb:123
c:0079 p:0152 s:0392 b:0392 l:000391 d:000391 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/action_controller/metal/instrumentation.rb:29
c:0078 p:0143 s:0387 b:0387 l:000386 d:000386 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/action_controller/metal/params_wrapper.rb:205
c:0077 p:0032 s:0381 b:0381 l:000380 d:000380 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.2.0/lib/active_record/railties/controller_runtime.rb:18
c:0076 p:0093 s:0376 b:0376 l:000375 d:000375 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/abstract_controller/base.rb:121
c:0075 p:0084 s:0370 b:0370 l:000369 d:000369 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/abstract_controller/rendering.rb:45
c:0074 p:0048 s:0365 b:0365 l:000364 d:000364 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/action_controller/metal.rb:203
c:0073 p:0086 s:0360 b:0360 l:000359 d:000359 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/action_controller/metal/rack_delegation.rb:14
c:0072 p:0030 s:0354 b:0354 l:000928 d:000353 BLOCK  /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/action_controller/metal.rb:246
c:0071 p:---- s:0351 b:0351 l:000350 d:000350 FINISH
c:0070 p:---- s:0349 b:0349 l:000348 d:000348 CFUNC  :call
c:0069 p:0022 s:0345 b:0345 l:000344 d:000344 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/action_dispatch/routing/route_set.rb:66
c:0068 p:0094 s:0339 b:0339 l:000338 d:000338 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/action_dispatch/routing/route_set.rb:30
c:0067 p:0026 s:0333 b:0333 l:000332 d:000332 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/action_dispatch/routing/mapper.rb:40
c:0066 p:0184 s:0329 b:0329 l:000312 d:000328 BLOCK  /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/journey-1.0.4/lib/journey/router.rb:68
c:0065 p:---- s:0318 b:0318 l:000317 d:000317 FINISH
c:0064 p:---- s:0316 b:0316 l:000315 d:000315 CFUNC  :each
c:0063 p:0051 s:0313 b:0313 l:000312 d:000312 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/journey-1.0.4/lib/journey/router.rb:56
c:0062 p:0025 s:0309 b:0309 l:000308 d:000308 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/action_dispatch/routing/route_set.rb:570
c:0061 p:0015 s:0305 b:0305 l:000304 d:000304 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/rack-pjax-0.5.9/lib/rack/pjax.rb:12
c:0060 p:0014 s:0297 b:0297 l:000288 d:000296 BLOCK  /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/warden-1.2.1/lib/warden/manager.rb:35
c:0059 p:---- s:0295 b:0295 l:000294 d:000294 FINISH
c:0058 p:---- s:0293 b:0293 l:000292 d:000292 CFUNC  :catch
c:0057 p:0086 s:0289 b:0289 l:000288 d:000288 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/warden-1.2.1/lib/warden/manager.rb:34
c:0056 p:0015 s:0284 b:0284 l:000283 d:000283 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/action_dispatch/middleware/best_standards_support.rb:17
c:0055 p:0015 s:0277 b:0277 l:000276 d:000276 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.1/lib/rack/etag.rb:23
c:0054 p:0052 s:0269 b:0269 l:000268 d:000268 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.1/lib/rack/conditionalget.rb:35
c:0053 p:0093 s:0262 b:0262 l:000261 d:000261 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/action_dispatch/middleware/head.rb:14
c:0052 p:0046 s:0255 b:0255 l:000254 d:000254 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/action_dispatch/middleware/params_parser.rb:21
c:0051 p:0054 s:0250 b:0250 l:000249 d:000249 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/action_dispatch/middleware/flash.rb:242
c:0050 p:0031 s:0242 b:0242 l:000241 d:000241 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:205
c:0049 p:0013 s:0234 b:0234 l:000233 d:000233 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:200
c:0048 p:0020 s:0230 b:0230 l:000229 d:000229 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/action_dispatch/middleware/cookies.rb:338
c:0047 p:0064 s:0222 b:0222 l:000221 d:000221 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.2.0/lib/active_record/query_cache.rb:64
c:0046 p:0029 s:0213 b:0213 l:000212 d:000212 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:4
c:0045 p:0014 s:0205 b:0205 l:001da0 d:000204 BLOCK  /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/action_dispatch/middleware/callbacks.rb:28
c:0044 p:0040 s:0203 b:0203 l:000202 d:000202 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:405
c:0043 p:0112 s:0196 b:0196 l:000195 d:000195 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:405
c:0042 p:0027 s:0187 b:0187 l:000186 d:000186 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:385
c:0041 p:0024 s:0182 b:0182 l:000181 d:000181 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:81
c:0040 p:0013 s:0176 b:0176 l:001da0 d:001da0 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/action_dispatch/middleware/callbacks.rb:27
c:0039 p:0039 s:0172 b:0172 l:000171 d:000171 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/action_dispatch/middleware/reloader.rb:65
c:0038 p:0044 s:0167 b:0167 l:000166 d:000166 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/action_dispatch/middleware/remote_ip.rb:31
c:0037 p:0017 s:0163 b:0163 l:000162 d:000162 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/action_dispatch/middleware/debug_exceptions.rb:16
c:0036 p:0017 s:0156 b:0156 l:000155 d:000155 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/action_dispatch/middleware/show_exceptions.rb:56
c:0035 p:0121 s:0150 b:0150 l:000149 d:000149 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.0/lib/rails/rack/logger.rb:26
c:0034 p:0052 s:0144 b:0144 l:000143 d:000143 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.0/lib/rails/rack/logger.rb:16
c:0033 p:0048 s:0140 b:0140 l:000139 d:000139 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/action_dispatch/middleware/request_id.rb:22
c:0032 p:0095 s:0133 b:0133 l:000132 d:000132 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.1/lib/rack/methodoverride.rb:21
c:0031 p:0032 s:0128 b:0128 l:000127 d:000127 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.1/lib/rack/runtime.rb:17
c:0030 p:0057 s:0119 b:0119 l:000118 d:000118 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0/lib/active_support/cache/strategy/local_cache.rb:72
c:0029 p:0068 s:0115 b:0115 l:000114 d:000114 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.1/lib/rack/lock.rb:15
c:0028 p:0124 s:0109 b:0109 l:000108 d:000108 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/action_dispatch/middleware/static.rb:53
c:0027 p:0032 s:0103 b:0103 l:000102 d:000102 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.0/lib/rails/engine.rb:479
c:0026 p:0034 s:0099 b:0099 l:000098 d:000098 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.0/lib/rails/application.rb:220
c:0025 p:0015 s:0095 b:0095 l:000094 d:000094 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.1/lib/rack/content_length.rb:14
c:0024 p:0015 s:0086 b:0086 l:000085 d:000085 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.0/lib/rails/rack/log_tailer.rb:14
c:0023 p:0020 s:0081 b:0081 l:000072 d:000080 BLOCK  /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/thin-1.3.1/lib/thin/connection.rb:80
c:0022 p:---- s:0079 b:0079 l:000078 d:000078 FINISH
c:0021 p:---- s:0077 b:0077 l:000076 d:000076 CFUNC  :catch
c:0020 p:0135 s:0073 b:0073 l:000072 d:000072 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/thin-1.3.1/lib/thin/connection.rb:78
c:0019 p:0088 s:0068 b:0067 l:000066 d:000066 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/thin-1.3.1/lib/thin/connection.rb:53
c:0018 p:0036 s:0064 b:0064 l:000063 d:000063 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/thin-1.3.1/lib/thin/connection.rb:38
c:0017 p:---- s:0059 b:0059 l:000058 d:000058 FINISH
c:0016 p:---- s:0057 b:0057 l:000056 d:000056 CFUNC  :run_machine
c:0015 p:0248 s:0054 b:0054 l:000053 d:000053 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/eventmachine-0.12.10/lib/eventmachine.rb:256
c:0014 p:0066 s:0047 b:0047 l:001320 d:001320 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/thin-1.3.1/lib/thin/backends/base.rb:61
c:0013 p:0143 s:0043 b:0043 l:000042 d:000042 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/thin-1.3.1/lib/thin/server.rb:159
c:0012 p:0081 s:0040 b:0040 l:000039 d:000039 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.1/lib/rack/handler/thin.rb:13
c:0011 p:0271 s:0034 b:0034 l:000290 d:000290 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.1/lib/rack/server.rb:265
c:0010 p:0231 s:0028 b:0028 l:0010c0 d:0010c0 METHOD /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.0/lib/rails/commands/server.rb:70
c:0009 p:0063 s:0024 b:0024 l:000015 d:000023 BLOCK  /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.0/lib/rails/commands.rb:55
c:0008 p:---- s:0021 b:0021 l:000020 d:000020 FINISH
c:0007 p:---- s:0019 b:0019 l:000018 d:000018 CFUNC  :tap
c:0006 p:0702 s:0016 b:0016 l:000015 d:000015 TOP    /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.0/lib/rails/commands.rb:50
c:0005 p:---- s:0012 b:0012 l:000011 d:000011 FINISH
c:0004 p:---- s:0010 b:0010 l:000009 d:000009 CFUNC  :require
c:0003 p:0061 s:0006 b:0006 l:002678 d:000108 EVAL   script/rails:6
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:002678 d:002678 TOP   

-- Ruby level backtrace information ----------------------------------------
script/rails:6:in `<main>'
script/rails:6:in `require'
/Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.0/lib/rails/commands.rb:50:in `<top (required)>'
/Users/dave/.rvm/gems/ruby-1.9.3-p0/g

注册控制器

class RegistrationsController < Devise::RegistrationsController
  def create
    @user = User.new(params[:user])
    @user.build_store(params[:store])
    if @user.save
      UserMailer.signup_confirmation(@user).deliver
      sign_in @user
      redirect_to @user, :flash => {:success => "Welcome to the App"}
    else
      render 'new'
      @title = "Sign up"
    end
  end
end

用户邮件

class UserMailer < ActionMailer::Base
  default from: "johndoe@gmail.com"

  def signup_confirmation(user)
    @user = user

    mail to: user.email, subject: "Thank You for Registering with us"
  end
end

开发环境

Outdoor::Application.configure do
  # Settings specified here will take precedence over those in config/application.rb

  # In the development environment your application's code is reloaded on
  # every request.  This slows down response time but is perfect for development
  # since you don't have to restart the web server when you make code changes.
  config.cache_classes = false

  # Log error messages when you accidentally call methods on nil.
  config.whiny_nils = true

  # Show full error reports and disable caching
  config.consider_all_requests_local       = true
  config.action_controller.perform_caching = false

  # Don't care if the mailer can't send
  config.action_mailer.raise_delivery_errors = true

  #SMTP 
  config.action_mailer.default_url_options = { :host => 'localhost:3000' }
  config.action_mailer.delivery_method = :smtp
  config.action_mailer.smtp_settings = {
  :address              => "smtp.gmail.com",
  :port                 => 587,
  :user_name            => 'Mygmail Account',
  :password             => 'MyPassword',
  :authentication       => 'plain',
  :enable_starttls_auto => true  }


  # Print deprecation notices to the Rails logger
  config.active_support.deprecation = :log

  # Only use best-standards-support built into browsers
  config.action_dispatch.best_standards_support = :builtin

  # Do not compress assets
  config.assets.compress = false

  # Expands the lines which load the assets
  config.assets.debug = true
end
4

1 回答 1

1

奇怪的是,在您的开发日志中没有太多关于错误的信息,因为它应该是(我希望您不会错过日志文件的后半部分)。

而且最常见的错误是没有正确设置 SMTP 设置。

只需打开您的邮件传递错误 (config/environments/development.rb)

config.action_mailer.raise_delivery_errors = true

以下是我在 Gmail 中使用的示例设置

config.action_mailer.default_url_options = { :host => 'localhost:3000' }
ActionMailer::Base.smtp_settings = {
                    :address        => "smtp.gmail.com",
                    :port           => 587,
                    :authentication => :plain,
                    :user_name      => "sameera207@gmail.com",
                    :password       => "<my gmail password>",
                    :openssl_verify_mode  => 'none'
  }
于 2012-08-05T16:26:14.977 回答