Activerecord Mailing (ar_mailer)

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:ingem_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:ingem_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:inrails’
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:inload’
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.

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:inrender’
vendor/rails/actionmailer/lib/action_mailer/base.rb:483:in render' vendor/rails/actionmailer/lib/action_mailer/base.rb:478:inrender_message’
vendor/rails/actionmailer/lib/action_mailer/base.rb:426:in create!' vendor/rails/actionmailer/lib/action_mailer/base.rb:387:ininitialize’
vendor/rails/actionmailer/lib/action_mailer/base.rb:335:in new' vendor/rails/actionmailer/lib/action_mailer/base.rb:335:inmethod_missing’
app/models/venta.rb:43:in reclamacion_pendientes_dia_26' app/models/venta.rb:41:ineach’
app/models/venta.rb:41:in reclamacion_pendientes_dia_26' app/controllers/ventas_pendientes_controller.rb:90:innotificar_26’
app/controllers/ventas_pendientes_controller.rb:40:in submit_form' -e:2:inload’
-e:2

Any help?

Juanma C.

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 :slight_smile:

Enjoy,
Reinhart
{$_$} http://teapoci.blogspot.com

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs