# Activerecord Mailing (ar\_mailer)

**URL:** <https://www.ruby-forum.com/t/activerecord-mailing-ar-mailer/115625>\
**Category:** Rails\
**Created:** [September 26, 2007, 11:43pm UTC](https://www.ruby-forum.com/t/activerecord-mailing-ar-mailer/115625 "2007-09-26T23:43:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmcervera](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/51bf81/32.png) [@jmcervera](https://www.ruby-forum.com/u/jmcervera)\
**Post date:** [September 26, 2007, 11:43pm UTC](https://www.ruby-forum.com/t/activerecord-mailing-ar-mailer/115625/1 "2007-09-26T23:43:55Z")

</div>

I am trying to run ar\_mailer for mass mailings, but I canÂ´t get my  
server started after adding the sentence  
require ‘action\_mailer/ar\_mailer’  
in environment.rb

I am using Windows XP, Ruby 1.8.6, and Rails 1.2.3/Edge Rails.  
This is the error I get

\*\* Starting Mongrel listening at 0.0.0.0:3000  
\*\* Starting Rails with development environment…  
C:/Documents and  
Settings/jmcervera/work/project1/vendor/rails/actionmailer/lib/…/…/actionpack/lib/…/…/activesupport/lib/active\_support/dependencies.rb:477:in  
`const_missing': uninitialized constant ActionMailer::ARMailer::Email (NameError) from c:/ruby/lib/ruby/gems/1.8/gems/ar_mailer-1.3.1/lib/action_mailer/ar_mailer.rb:70 from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in`gem\_original\_require’  
from c:/ruby/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:32:in  
`require' from C:/Documents and Settings/jmcervera/work/project1/config/environment.rb:14 from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in`gem\_original\_require’  
from c:/ruby/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
`require' from c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel/rails.rb:155:in`rails’  
from  
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/bin/mongrel\_rails:112:in  
`cloaker_' ... 9 levels... from c:\ruby\bin\mongrel_rails:16:in`load’  
from c:\ruby\bin\mongrel\_rails:16  
from -e:2:in `load’  
from -e:2

I have the same error, even trying to do that require in irb.

Does this gem works with Windows XP?

Thanks in advance.

Juanma C.

---

<div class="post-metadata">

**Author:** ![jmcervera](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/51bf81/32.png) [@jmcervera](https://www.ruby-forum.com/u/jmcervera)\
**Post date:** [September 27, 2007, 10:53am UTC](https://www.ruby-forum.com/t/activerecord-mailing-ar-mailer/115625/2 "2007-09-27T10:53:10Z")

</div>

Well. It seems that the problem has nothing to do with windows XP.  
Maybe the problem is with Edge Rails.  
Now, I have moved the sentence require ‘action\_mailer/ar\_mailer’ to  
config/environments/\*.rb instead of config/environment.rb and the server  
starts.  
But now, as soon as I change the base class of the mailer classes to  
ActionMailer::ARMailer the template file could not be finded by  
ActionVier.

This is the error I get. ‘prueba’ is the name of template in this case.

Couldn’t find template file for prueba in “/ventas\_mailer”

vendor/rails/actionpack/lib/action\_view/base.rb:282:in `render_file' vendor/rails/actionpack/lib/action_view/base.rb:318:in`render’  
vendor/rails/actionmailer/lib/action\_mailer/base.rb:483:in `render' vendor/rails/actionmailer/lib/action_mailer/base.rb:478:in`render\_message’  
vendor/rails/actionmailer/lib/action\_mailer/base.rb:426:in `create!' vendor/rails/actionmailer/lib/action_mailer/base.rb:387:in`initialize’  
vendor/rails/actionmailer/lib/action\_mailer/base.rb:335:in `new' vendor/rails/actionmailer/lib/action_mailer/base.rb:335:in`method\_missing’  
app/models/venta.rb:43:in `reclamacion_pendientes_dia_26' app/models/venta.rb:41:in`each’  
app/models/venta.rb:41:in `reclamacion_pendientes_dia_26' app/controllers/ventas_pendientes_controller.rb:90:in`notificar\_26’  
app/controllers/ventas\_pendientes\_controller.rb:40:in `submit_form' -e:2:in`load’  
-e:2

Any help?

Juanma C.

---

<div class="post-metadata">

**Author:** ![jmcervera](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/51bf81/32.png) [@jmcervera](https://www.ruby-forum.com/u/jmcervera)\
**Post date:** [April 8, 2008, 8:46am UTC](https://www.ruby-forum.com/t/activerecord-mailing-ar-mailer/115625/3 "2008-04-08T08:46:09Z")

</div>

I have the problem like it before. What I do is :

1. Re-install Gem
2. do script/mailer again, but do not replace model
3. restart my server
4. Back working 🙂

Enjoy,  
Reinhart  
{$\_$} [http://teapoci.blogspot.com](http://teapoci.blogspot.com)
