设计可恢复模型无法在heroku上运行错误

时间:2013-09-30 16:53:47

标签: ruby-on-rails devise actionmailer

我遇到设计和可恢复(忘记密码)模型的问题。在本地我可以重置密码,一切似乎工作正常。但在实时网站(heroku)上,我得到了一般错误。请参阅下面的我的heroku日志 - 任何帮助都会很棒,因为我不知道发生了什么........

 C:\sites\code\OM Rails\omrails>heroku logs
    2013-09-30T16:38:54.749079+00:00 app[web.1]:   Rendered pages/_home.html.erb (0.
    6ms)
    2013-09-30T16:38:55.935268+00:00 app[web.1]:   Rendered pins/index.html.erb with
    in layouts/application (1273.1ms)
    2013-09-30T16:38:55.935268+00:00 app[web.1]:   Rendered pins/_pin.html.erb (1190
    .0ms)
    2013-09-30T16:38:55.935268+00:00 app[web.1]:   Rendered layouts/_footer.html.erb
     (0.2ms)
    2013-09-30T16:38:55.935268+00:00 app[web.1]:   Rendered layouts/_header.html.erb
     (1.0ms)
    2013-09-30T16:38:55.935268+00:00 app[web.1]: Completed 200 OK in 1279ms (Views:
    858.6ms | ActiveRecord: 419.0ms)
    2013-09-30T16:38:55.936609+00:00 heroku[router]: at=info method=GET path=/ host=
    www.barnpix.com fwd="67.165.53.20" dyno=web.1 connect=1ms service=1298ms status=
    304 bytes=0
    2013-09-30T16:39:00.636355+00:00 app[web.1]: Started GET "/users/sign_in" for 67
    .165.53.20 at 2013-09-30 16:39:00 +0000
    2013-09-30T16:39:00.747339+00:00 app[web.1]:   Rendered devise/sessions/new.html
    .erb within layouts/application (97.0ms)
    2013-09-30T16:39:00.747339+00:00 app[web.1]:   Rendered layouts/_header.html.erb
     (1.1ms)
    2013-09-30T16:39:00.747339+00:00 app[web.1]:   Rendered layouts/_footer.html.erb
     (0.1ms)
    2013-09-30T16:39:00.747339+00:00 app[web.1]: Completed 200 OK in 105ms (Views: 1
    02.4ms | ActiveRecord: 0.0ms)
    2013-09-30T16:39:00.747339+00:00 app[web.1]: Processing by Devise::SessionsContr
    oller#new as HTML
    2013-09-30T16:39:00.747339+00:00 app[web.1]:   Rendered devise/shared/_links.erb
     (1.5ms)
    2013-09-30T16:39:00.778981+00:00 heroku[router]: at=info method=GET path=/users/
    sign_in host=www.barnpix.com fwd="67.165.53.20" dyno=web.1 connect=2ms service=1
    50ms status=200 bytes=4742
    2013-09-30T16:38:23.708716+00:00 heroku[router]: at=info method=GET path=/tags/F
    ilter host=www.barnpix.com fwd="5.10.83.62" dyno=web.1 connect=2ms service=300ms
     status=200 bytes=5758
    2013-09-30T16:44:57.812549+00:00 app[web.1]: Processing by UsersController#show
    as */*
    2013-09-30T16:44:57.812549+00:00 app[web.1]:   Parameters: {"id"=>"8"}
    2013-09-30T16:44:57.812549+00:00 app[web.1]:   Rendered layouts/_footer.html.erb
     (0.0ms)
    2013-09-30T16:44:57.812549+00:00 app[web.1]: Completed 200 OK in 88ms (Views: 57
    .1ms | ActiveRecord: 25.3ms)
    2013-09-30T16:44:57.812549+00:00 app[web.1]:   Rendered users/show.html.erb with
    in layouts/application (66.6ms)
    2013-09-30T16:44:57.812549+00:00 app[web.1]:   Rendered layouts/_header.html.erb
     (0.9ms)
    2013-09-30T16:44:57.710527+00:00 app[web.1]: Started GET "/users/8" for 180.76.5
    .155 at 2013-09-30 16:44:57 +0000
    2013-09-30T16:44:57.812549+00:00 app[web.1]:   Rendered pins/_pin.html.erb (61.0
    ms)
    2013-09-30T16:45:16+00:00 heroku[slug-compiler]: Slug compilation started
    2013-09-30T16:44:57.810949+00:00 heroku[router]: at=info method=GET path=/users/
    8 host=www.barnpix.com fwd="180.76.5.155" dyno=web.1 connect=30ms service=108ms
    status=200 bytes=4815
    2013-09-30T16:46:41.635661+00:00 heroku[api]: Deploy 5d905f7 by art.westiv@gmail
    .com
    2013-09-30T16:46:41.661607+00:00 heroku[api]: Release v345 created by art.westiv
    @gmail.com
    2013-09-30T16:46:42+00:00 heroku[slug-compiler]: Slug compilation finished
    2013-09-30T16:46:46.329209+00:00 heroku[web.1]: Stopping all processes with SIGT
    ERM
    2013-09-30T16:46:47.329475+00:00 app[web.1]: [2013-09-30 16:46:47] INFO  WEBrick
    ::HTTPServer#start done.
    2013-09-30T16:46:47.329232+00:00 app[web.1]: [2013-09-30 16:46:47] FATAL SignalE
    xception: SIGTERM
    2013-09-30T16:46:47.329232+00:00 app[web.1]:    /app/vendor/ruby-2.0.0/lib/ruby/
    2.0.0/webrick/server.rb:170:in `select'
    2013-09-30T16:46:47.329232+00:00 app[web.1]:    /app/vendor/ruby-2.0.0/lib/ruby/
    2.0.0/webrick/server.rb:170:in `block in start'
    2013-09-30T16:46:47.329232+00:00 app[web.1]:    /app/vendor/ruby-2.0.0/lib/ruby/
    2.0.0/webrick/server.rb:32:in `start'
    2013-09-30T16:46:47.329232+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/ge
    ms/rack-1.4.5/lib/rack/handler/webrick.rb:13:in `run'
    2013-09-30T16:46:47.329232+00:00 app[web.1]:    /app/vendor/ruby-2.0.0/lib/ruby/
    2.0.0/webrick/server.rb:160:in `start'
    2013-09-30T16:46:47.329232+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/ge
    ms/rack-1.4.5/lib/rack/server.rb:268:in `start'
    2013-09-30T16:46:47.329232+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/ge
    ms/railties-3.2.13/lib/rails/commands/server.rb:70:in `start'
    2013-09-30T16:46:47.329475+00:00 app[web.1]: Exiting
    2013-09-30T16:46:47.329475+00:00 app[web.1]:    script/rails:6:in `require'
    2013-09-30T16:46:47.329232+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/ge
    ms/railties-3.2.13/lib/rails/commands.rb:55:in `block in <top (required)>'
    2013-09-30T16:46:47.329475+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/ge
    ms/railties-3.2.13/lib/rails/commands.rb:50:in `<top (required)>'
    2013-09-30T16:46:47.329232+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/ge
    ms/railties-3.2.13/lib/rails/commands.rb:50:in `tap'
    2013-09-30T16:46:47.329475+00:00 app[web.1]: [2013-09-30 16:46:47] INFO  going t
    o shutdown ...
    2013-09-30T16:46:47.329475+00:00 app[web.1]:    script/rails:6:in `<main>'
    2013-09-30T16:46:49.501157+00:00 heroku[web.1]: Process exited with status 143
    2013-09-30T16:46:49.550299+00:00 heroku[web.1]: Starting process with command `b
    undle exec rails server -p 52719`
    2013-09-30T16:46:57.771649+00:00 app[web.1]: DEPRECATION WARNING: You have Rails
     2.3-style plugins in vendor/plugins! Support for these plugins will be removed
    in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to
    your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release
    notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-h
    as-been-released. (called from <top (required)> at /app/config/environment.rb:5)

    2013-09-30T16:46:57.772279+00:00 app[web.1]: DEPRECATION WARNING: You have Rails
     2.3-style plugins in vendor/plugins! Support for these plugins will be removed
    in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to
    your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release
    notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-h
    as-been-released. (called from <top (required)> at /app/config/environment.rb:5)

    2013-09-30T16:47:01.430419+00:00 app[web.1]: [2013-09-30 16:47:01] INFO  WEBrick
    ::HTTPServer#start: pid=2 port=52719
    2013-09-30T16:47:01.430053+00:00 app[web.1]: [2013-09-30 16:47:01] INFO  WEBrick
     1.3.1
    2013-09-30T16:47:01.430053+00:00 app[web.1]: [2013-09-30 16:47:01] INFO  ruby 2.
    0.0 (2013-06-27) [x86_64-linux]
    2013-09-30T16:47:01.732740+00:00 heroku[web.1]: State changed from starting to u
    p
    2013-09-30T16:47:42.825270+00:00 app[web.1]: => Booting WEBrick
    2013-09-30T16:47:42.825270+00:00 app[web.1]: => Call with -d to detach
    2013-09-30T16:47:42.825270+00:00 app[web.1]: => Rails 3.2.13 application startin
    g in production on http://0.0.0.0:52719
    2013-09-30T16:47:42.825270+00:00 app[web.1]: => Ctrl-C to shutdown server
    2013-09-30T16:47:42.825270+00:00 app[web.1]: Started GET "/" for 67.165.53.20 at
     2013-09-30 16:47:42 +0000
    2013-09-30T16:47:48.667819+00:00 app[web.1]: Processing by PinsController#index
    as HTML
    2013-09-30T16:47:48.667819+00:00 app[web.1]:   Rendered layouts/_header.html.erb
     (2.0ms)
    2013-09-30T16:47:48.667819+00:00 app[web.1]:   Rendered pages/_home.html.erb (13
    .7ms)
    2013-09-30T16:47:48.667819+00:00 app[web.1]:   Rendered pins/index.html.erb with
    in layouts/application (5354.8ms)
    2013-09-30T16:47:48.667819+00:00 app[web.1]: Completed 200 OK in 5421ms (Views:
    4517.5ms | ActiveRecord: 883.7ms)
    2013-09-30T16:47:48.667819+00:00 app[web.1]:   Rendered pins/_pin.html.erb (3862
    .2ms)
    2013-09-30T16:47:48.667819+00:00 app[web.1]:   Rendered layouts/_footer.html.erb
     (0.5ms)
    2013-09-30T16:47:48.819159+00:00 app[web.1]: Started GET "/" for 67.165.53.20 at
     2013-09-30 16:47:48 +0000
    2013-09-30T16:47:48.839217+00:00 app[web.1]: Processing by PinsController#index
    as HTML
    2013-09-30T16:47:51.181343+00:00 app[web.1]:   Rendered pages/_home.html.erb (0.
    7ms)
    2013-09-30T16:47:51.181343+00:00 app[web.1]:   Rendered pins/_pin.html.erb (2181
    .0ms)
    2013-09-30T16:47:51.181343+00:00 app[web.1]:   Rendered pins/index.html.erb with
    in layouts/application (2299.2ms)
    2013-09-30T16:47:51.181343+00:00 app[web.1]:   Rendered layouts/_footer.html.erb
     (0.0ms)
    2013-09-30T16:47:51.181343+00:00 app[web.1]:   Rendered layouts/_header.html.erb
     (1.0ms)
    2013-09-30T16:47:51.181343+00:00 app[web.1]: Completed 200 OK in 2314ms (Views:
    1740.8ms | ActiveRecord: 571.6ms)
    2013-09-30T16:47:51.185386+00:00 heroku[router]: at=info method=GET path=/ host=
    www.barnpix.com fwd="67.165.53.20" dyno=web.1 connect=2ms service=2391ms status=
    304 bytes=0
    2013-09-30T16:47:52.903556+00:00 app[web.1]: Started GET "/users/sign_in" for 67
    .165.53.20 at 2013-09-30 16:47:52 +0000
    2013-09-30T16:47:53.100867+00:00 app[web.1]: Processing by Devise::SessionsContr
    oller#new as HTML
    2013-09-30T16:47:53.100867+00:00 app[web.1]:   Rendered devise/shared/_links.erb
     (2.4ms)
    2013-09-30T16:47:53.100867+00:00 app[web.1]:   Rendered layouts/_footer.html.erb
     (0.1ms)
    2013-09-30T16:47:53.100867+00:00 app[web.1]:   Rendered devise/sessions/new.html
    .erb within layouts/application (159.2ms)
    2013-09-30T16:47:53.100867+00:00 app[web.1]: Completed 200 OK in 170ms (Views: 1
    64.8ms | ActiveRecord: 0.0ms)
    2013-09-30T16:47:53.100867+00:00 app[web.1]:   Rendered layouts/_header.html.erb
     (1.0ms)
    2013-09-30T16:47:53.101302+00:00 heroku[router]: at=info method=GET path=/users/
    sign_in host=www.barnpix.com fwd="67.165.53.20" dyno=web.1 connect=1ms service=2
    15ms status=200 bytes=4806
    2013-09-30T16:47:54.344205+00:00 app[web.1]: Started GET "/users/password/new" f
    or 67.165.53.20 at 2013-09-30 16:47:54 +0000
    2013-09-30T16:47:54.366598+00:00 app[web.1]:   Rendered layouts/_footer.html.erb
     (0.0ms)
    2013-09-30T16:47:54.366598+00:00 app[web.1]:   Rendered devise/shared/_links.erb
     (0.9ms)
    2013-09-30T16:47:54.366598+00:00 app[web.1]: Completed 200 OK in 14ms (Views: 12
    .9ms | ActiveRecord: 0.0ms)
    2013-09-30T16:47:54.366598+00:00 app[web.1]:   Rendered layouts/_header.html.erb
     (1.5ms)
    2013-09-30T16:47:54.366598+00:00 app[web.1]:   Rendered devise/passwords/new.htm
    l.erb within layouts/application (5.2ms)
    2013-09-30T16:47:54.366598+00:00 app[web.1]: Processing by Devise::PasswordsCont
    roller#new as HTML
    2013-09-30T16:47:54.369061+00:00 heroku[router]: at=info method=GET path=/users/
    password/new host=www.barnpix.com fwd="67.165.53.20" dyno=web.1 connect=9ms serv
    ice=29ms status=304 bytes=0
    2013-09-30T16:47:59.918231+00:00 app[web.1]: Started POST "/users/password" for
    67.165.53.20 at 2013-09-30 16:47:59 +0000
    2013-09-30T16:48:00.903601+00:00 app[web.1]:
    2013-09-30T16:48:00.904018+00:00 app[web.1]: Completed 500 Internal Server Error
     in 973ms
    2013-09-30T16:48:00.903601+00:00 app[web.1]:
    2013-09-30T16:48:00.903601+00:00 app[web.1]:   app/mailers/user_mailer.rb:6:in `
    reset_password_instructions'
    2013-09-30T16:48:00.903601+00:00 app[web.1]:
    2013-09-30T16:48:00.903601+00:00 app[web.1]: ArgumentError (wrong number of argu
    ments (3 for 1..2)):
    2013-09-30T16:48:00.904018+00:00 app[web.1]: Processing by Devise::PasswordsCont
    roller#create as HTML
    2013-09-30T16:48:00.904018+00:00 app[web.1]:   Parameters: {"utf8"=>"???", "auth
    enticity_token"=>"1RE7603gfjk6QVUSjBwlL1EJMvgwq3q9a4pjqeoGFa8=", "user"=>{"email
    "=>"art@art.com"}, "commit"=>"Send me reset password instructions"}
    2013-09-30T16:48:00.912740+00:00 heroku[router]: at=info method=POST path=/users
    /password host=www.barnpix.com fwd="67.165.53.20" dyno=web.1 connect=5ms service
    =1006ms status=500 bytes=643

    C:\sites\code\OM Rails\omrails>

user_mailer.rb

class UserMailer < ActionMailer::Base
  include Devise::Mailers::Helpers

  default from: "info@barnpix.com"

  def reset_password_instructions(record, opts={})
       devise_mail(record, :reset_password_instructions)
     end
   end

1 个答案:

答案 0 :(得分:1)

您正在使用的邮件版本是旧版本。新版本如下所示:

https://github.com/plataformatec/devise/blob/master/app/mailers/devise/mailer.rb#L9

  def reset_password_instructions(record, token, opts={})
    @token = token
    devise_mail(record, :reset_password_instructions, opts)
  end