非法指令:使用 Rails 3 ActionMailer 时为 4
我正在尝试在 Rails 3.1 的开发环境中使用 gmail 发送。代码如下:
config/development.rb
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:address => "smtp.gmail.com",
:port => 587,
:domain => 'domain.com',
:user_name => 'domain',
:password => 'password',
:authentication => 'plain',
:enable_starttls_auto => true }
控制器
def forward_message(message)
@message = message
mail(:to => "[email protected]", :subject => "Test message")
end
和视图仅包含文本“test”
我像这样调用 ActionMailer 方法
MessageMailer.forward_message(@message).deliver
问题是 Rails 崩溃,给出“非法指令:4”
我想指出的是代码可以在生产机器上运行,我使用的是 Rails 3.1rc5。请告诉我如何调试此错误。
感谢您的帮助!
I am trying to use gmail sending in my development environment in Rails 3.1. The code is the following:
config/development.rb
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:address => "smtp.gmail.com",
:port => 587,
:domain => 'domain.com',
:user_name => 'domain',
:password => 'password',
:authentication => 'plain',
:enable_starttls_auto => true }
the controller
def forward_message(message)
@message = message
mail(:to => "[email protected]", :subject => "Test message")
end
and the view only contains the text "test"
I call the ActionMailer method like this
MessageMailer.forward_message(@message).deliver
The problem is that rails crashes giving out "Illegal instruction: 4"
I want to note that the code works on the production machine and I am using Rails 3.1rc5. Please advise me on how to debug this error.
Thanks for the help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论