简体   繁体   English

在新服务器上运行ar_mailer / ar_sendmail时出现问题

[英]Problem getting ar_mailer/ar_sendmail working on new server

Hey all. 大家好。 I've got a new app up and running on a new ubuntu server. 我有一个新的应用程序并在新的ubuntu服务器上运行。 It's working fine generally but i can't get ar_sendmail working. 通常来说,它工作正常,但是我无法使ar_sendmail工作。 I'm following the instructions on this page: http://www.ameravant.com/posts/sending-tons-of-emails-in-ruby-on-rails-with-ar_mailer 我正在按照此页面上的说明进行操作: http : //www.ameravant.com/posts/sending-tons-of-emails-in-ruby-on-rails-with-ar_mailer

The setup is all done, ie i can "deliver mails" which just saves records in my Email table. 设置已全部完成,即我可以“传递邮件”,而只是将记录保存在“电子邮件”表中。 Now i want to get the ar_sendmail daemon running to actually send them. 现在,我想运行ar_sendmail守护程序以实际发送它们。 (so i'm at 'Running ar_sendmail in daemon mode' in that web page). (所以我在该网页上处于“在守护程序模式下运行ar_sendmail”)。

First thing: 第一件事:

ar_sendmail --mailq
>>ar_sendmail: command not found

Ok...so, where is ar_sendmail? 好的...所以,ar_sendmail在哪里? I have a look and there's an ar_sendmail file in the bin folder of the ar_mailer plugin, so i add the location of that to my path. 我看了一下,在ar_mailer插件的bin文件夹中有一个ar_sendmail文件,因此我将其位置添加到了我的路径中。 I don't know if this was the right thing to do or not. 我不知道这是否正确。

Ok, so try again. 好的,再试一次。

ar_sendmail --mailq
/var/www/apps/millionaire/vendor/plugins/ar_mailer/bin/ar_sendmail:3:in `require': no such file to load -- action_mailer/ar_sendmail (LoadError)
    from /var/www/apps/millionaire/vendor/plugins/ar_mailer/bin/ar_sendmail:3

hmm. 嗯。 Here's the offending file, there's not much there. 这是有问题的文件,那里没有太多。

#!/usr/bin/env ruby

require 'action_mailer/ar_sendmail'

ActionMailer::ARSendmail.run

ok...so it literally is just trying to require this and can't find it. 好的...所以它实际上只是在试图要求它而找不到它。 The file, action_mailer/ar_sendmail.rb is in the ar_mailer plugin, in it's lib folder. 文件action_mailer / ar_sendmail.rb在ar_mailer插件的lib文件夹中。 So, given that it's being called from inside the plugin, it should be able to see this right? 那么,鉴于它是从插件内部调用的,它应该能够看到正确的显示吗?

I've got a feeling that i'm way off the track here and have missed something simple. 我有种感觉,我已经离开了这里,错过了一些简单的事情。 Can anyone set me straight? 谁能让我挺直? I'm using rails 2.3.4 in case that's relevant. 如果相关,我正在使用Rails 2.3.4。

EDIT - i just realised something kind of dumb: when i call ar_sendmail from the command line like this, i'm just loading that one file, which doesn't know where it's supposed to look for the rest of the stuff, i think. 编辑-我刚刚意识到有些愚蠢:当我从这样的命令行调用ar_sendmail时,我只是在加载那个文件,我想它不知道应该在哪里寻找其余的东西。 Which really makes me think that i'm not trying to run the right thing. 这确实让我觉得我没有在尝试做正确的事情。 Is the ar_sendmail daemon a seperate program altogether, that i would get with apt_get or something? ar_sendmail守护程序是否是一个单独的程序,可以通过apt_get或其他工具获得?

EDIT2 - i made some progress by installing the ar_mailer gem (which the guide said i shouldn't do) and that does seem to run. EDIT2-我通过安装ar_mailer gem(指南说我不应该这样做)取得了一些进展,并且看起来确实可以运行。 It's sending some mail request somewhere and clearing the Email table of pending emails. 它正在某处发送一些邮件请求并清除未决电子邮件的“电子邮件”表。 Running ar_sendmail in -ov (oneshot verbal) mode i see it report this for example: 我在-ov(oneshot口头)模式下运行ar_sendmail,例如,我看到它报告此情况:

sent email 00000000019 from from@address.com to to@address.com: # 从from@address.com向to@address.com发送了电子邮件00000000019:#

So, it actually looks like it's working now and i just need to set up the ACTUAL THING WHICH SENDS EMAILS. 因此,实际上看起来它现在正在工作,我只需要设置发送电子邮件的实际内容。 sigh. 叹。 still grateful for any advice. 仍然感谢任何建议。

thanks, max 谢谢,最大

What you need is an smtp server. 您需要的是smtp服务器。 Checkout www.sendgrid.com . 结帐www.sendgrid.com

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM