开发者

Rails 3 Setting Up Action Mailer

开发者 https://www.devze.com 2023-03-05 03:46 出处:网络
Everything was going so well... gem \'mail\' is installed enter > $ rails g scaffold user name:string email:string

Everything was going so well...

gem 'mail' is installed

enter > $ rails g scaffold user name:string email:string

enter > $ rake db:migrate (fine I can see it on http://localhost:3000/users/new) then...

enter > $ rails g mailer user_mailer

On this command I get this huge error - what is it and how do I resolve it?

Users/mailer_app/config/initializers/setup_mail.rb:14: uninitialized
constant DevelopmentMailInterceptor (NameError)
    from /opt/local/lib/ruby/gems/1.8/gems/railties-3.0.5/lib/rails/engine.rb:201
    from /opt/local/lib/ruby/gems/1.8/gems/railties-3.0.5/lib/rails/engine.rb:200:in `each'
    from /opt/local/lib/ruby/gems/1.8/gems/railties-3.0.5/lib/rails/engine.rb:200
    from /opt/local/lib/ruby/gems/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:25:in `instance_exec'
    from /opt/local/lib/ruby/gems/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:25:in `run'
    from /opt/local/lib/ruby/gems/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:50:in `run_initializers'
    from /opt/local/lib/ruby/gems/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:49:in `each'
    from /opt/local/lib/ruby/gems/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:49:in `run_initializers'
    from /opt/local/lib/ruby/gems/1.8/gems/railties-3.0.5/lib/rails/application.rb:134:in `initialize!'
    from /opt/local/lib/ruby/gems/1.8/gems/railties-3.0.5/lib/rails/application.rb:77:in `send'
    from /opt/local/lib/ruby/gems/1.8/gems/railties-3.0.5/lib/rails/application.rb:77:in `method_missing'
    from /Users/liam_carey/Documents/Aptana Studio 3 Workspace/mailer_test/config/environment.rb:5
    from /opt/local/lib/ruby/gems/1.8/gems/railties-3.0.5/lib/rails/application.rb:103:in `require'
    from /opt/local/lib/ruby/gems/1.8/gems/railties-3.0.5/lib/rails/application.rb:103:in `re开发者_JAVA百科quire_environment!'
    from /opt/local/lib/ruby/gems/1.8/gems/railties-3.0.5/lib/rails/commands.rb:16
    from script/rails:6:in `require'
    from script/rails:6
  user:mailer_app $ 


Here is the contents of my config/initializers/setup_mail.rb

Am using Heroku and Sendgrid and have installed the plug-in.

Did I need to install the 'mail' gem first, the documentation doesn't mention it??

ActionMailer::Base.smtp_settings = {
:address        => "smtp.sendgrid.net",
:port           => "25",
:authentication => :plain
:user_name      => "apxxxxx@heroku.com",
:password       => "9XXXXXXXXX",
:domain         => "www.myapp.com",
}

I know what the issue is now - there is no comma after the user-name and password entries!

0

精彩评论

暂无评论...
验证码 换一张
取 消