Rails 3 设置操作邮件程序



一切都很顺利...

已安装 gem"邮件"

输入> $ 导轨 G 脚手架 用户名:字符串 电子邮件:字符串

输入> $ rake db:migrate (很好,我可以在 http://localhost:3000/users/new 上看到它)然后...

输入> $ 轨道 g 邮件user_mailer

在这个命令上,我收到这个巨大的错误 - 它是什么以及如何解决它?

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 `require_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 $ 
这是我

的配置/初始值设定项/setup_mail.rb 的内容

我正在使用Heroku和Sendgrid并安装了插件。

我是否需要先安装"邮件"gem,文档没有提到它?

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

我知道现在的问题是什么 - 用户名和密码条目后没有逗号!

相关内容

  • 没有找到相关文章

最新更新