0

初めてRails 3アプリをherokuにデプロイしようとしていますが、スローされ続けuninitialized constant Mail::TestMailer (NameError)ます。ログファイルは次のとおりです

2013-01-13T00:35:41+00:00 app[web.1]: => Booting WEBrick
2013-01-13T00:35:41+00:00 app[web.1]: => Rails 3.2.11 application starting in production on http://0.0.0.0:11346
2013-01-13T00:35:41+00:00 app[web.1]: => Ctrl-C to shutdown server
2013-01-13T00:35:41+00:00 app[web.1]: Exiting
2013-01-13T00:35:41+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/actionmailer-3.2.11/lib/action_mailer/delivery_methods.rb:43:in `<module:ClassMethods>': uninitialized constant Mail::TestMailer (NameError)
2013-01-13T00:35:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/actionmailer-3.2.11/lib/action_mailer/delivery_methods.rb:41:in `<module:DeliveryMethods>'
2013-01-13T00:35:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/actionmailer-3.2.11/lib/action_mailer/delivery_methods.rb:6:in `<module:ActionMailer>'
2013-01-13T00:35:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/application/railties.rb:8:in `each'
2013-01-13T00:35:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/application/railties.rb:8:in `all'
2013-01-13T00:35:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/engine.rb:434:in `eager_load!'
2013-01-13T00:35:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/application/finisher.rb:53:in `block in <module:Finisher>'
2013-01-13T00:35:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/initializable.rb:30:in `instance_exec'
2013-01-13T00:35:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/initializable.rb:30:in `run'
2013-01-13T00:35:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/initializable.rb:55:in `block in run_initializers'
2013-01-13T00:35:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/initializable.rb:54:in `each'
2013-01-13T00:35:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/initializable.rb:54:in `run_initializers'
2013-01-13T00:35:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/application.rb:136:in `initialize!'
2013-01-13T00:35:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/railtie/configurable.rb:30:in `method_missing'
2013-01-13T00:35:41+00:00 app[web.1]:   from /app/config/environment.rb:5:in `<top (required)>'
2013-01-13T00:35:41+00:00 app[web.1]:   from /app/config.ru:3:in `block in <main>'
2013-01-13T00:35:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/commands/server.rb:46:in `app'
2013-01-13T00:35:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.3/lib/rack/server.rb:304:in `wrapped_app'
2013-01-13T00:35:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.3/lib/rack/server.rb:254:in `start'
2013-01-13T00:35:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/devise-2.1.2/app/mailers/devise/mailer.rb:1:in `<top (required)>'
2013-01-13T00:35:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/engine.rb:439:in `block (2 levels) in eager_load!'
2013-01-13T00:35:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/engine.rb:438:in `each'
2013-01-13T00:35:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/engine.rb:438:in `block in eager_load!'
2013-01-13T00:35:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/actionmailer-3.2.11/lib/action_mailer/base.rb:326:in `<module:ActionMailer>'
2013-01-13T00:35:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/actionmailer-3.2.11/lib/action_mailer/delivery_methods.rb:3:in `<top (required)>'
2013-01-13T00:35:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/commands/server.rb:70:in `start'
2013-01-13T00:35:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/commands.rb:55:in `block in <top (required)>'
2013-01-13T00:35:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/commands.rb:50:in `tap'
2013-01-13T00:35:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/commands.rb:50:in `<top (required)>'
2013-01-13T00:35:41+00:00 app[web.1]:   from script/rails:6:in `require'
2013-01-13T00:35:41+00:00 app[web.1]:   from script/rails:6:in `<main>'
2013-01-13T00:35:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/actionmailer-3.2.11/lib/action_mailer/base.rb:327:in `<class:Base>'
2013-01-13T00:35:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.3/lib/rack/builder.rb:40:in `eval'
2013-01-13T00:35:41+00:00 app[web.1]:   from /app/config.ru:in `<main>'
2013-01-13T00:35:41+00:00 app[web.1]:   from /app/config.ru:in `new'
2013-01-13T00:35:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.3/lib/rack/builder.rb:51:in `instance_eval'
2013-01-13T00:35:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.3/lib/rack/builder.rb:51:in `initialize'
2013-01-13T00:35:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.3/lib/rack/builder.rb:40:in `parse_file'
2013-01-13T00:35:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.3/lib/rack/server.rb:200:in `app'
2013-01-13T00:35:41+00:00 app[web.1]: => Call with -d to detach
2013-01-13T00:35:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/actionmailer-3.2.11/lib/action_mailer/base.rb:11:in `<top (required)>'
2013-01-13T00:35:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/engine.rb:436:in `eager_load!'
2013-01-13T00:35:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/engine.rb:436:in `each'
2013-01-13T00:35:42+00:00 heroku[web.1]: Process exited with status 1
2013-01-13T00:35:42+00:00 heroku[web.1]: State changed from starting to crashed

そして、私のGemfileは次のようになります

source 'https://rubygems.org'

gem 'rails', '3.2.11'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

gem "paperclip", "~> 3.0"
gem 'json'
#json parsing from web
gem 'yajl-ruby'
# gem 'rqrcode' #table qrcodes
gem 'rqrcode-rails3' #imageqrcodes
gem 'mini_magick'


gem 'devise'
gem 'simple_form'
gem 'jquery-rails'
gem 'jquery-mobile-rails'
# gem 'activeadmin'
# gem 'nested_form', :git => 'git://github.com/ryanb/nested_form.git'
gem 'cancan'
# gem "select2-rails"
gem 'friendly_id', :git => "git://github.com/norman/friendly_id.git"

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer', :platform => :ruby

  gem 'uglifier', '>= 1.0.3'
  gem 'twitter-bootstrap-rails'
  # gem 'less-rails'
  # gem 'execjs', '1.4.0'
  # gem 'therubyracer', '0.10.2'
end

group :development, :test do
  gem 'mysql2'
end

group :production do
  gem 'pg'
end

私はdeviseを使用してユーザー登録を処理しているので、deviseが確認メールを送信しようとしていると思いました。production.rbしかし、このようにaction_mailerの設定を追加した後

  config.action_mailer.raise_delivery_errors = false
  config.action_mailer.perform_deliveries = true
  config.action_mailer.delivery_method = :smtp
  config.action_mailer.smtp_settings = {
    address:              'smtp.gmail.com',
    port:                 587,
    tls:                  true,
    domain:               'gmail.com',
    user_name:            'secret@email.com',
    password:             'secret',
    authentication:       'plain',
    enable_starttls_auto: true  
  }

それはまだ私にエラーを与えていません

前もって感謝します

4

1 に答える 1

1

メール モデルの名前を変更する場合は、必ずファイル app/models/mail.rb の名前を変更し、新しいモデルに一致するように mails テーブルの名前を変更する移行を追加してください。

于 2013-01-13T03:01:48.537 に答える