# Actionmailer - TypeError: can't dup NilClass

**URL:** <https://www.ruby-forum.com/t/actionmailer-typeerror-cant-dup-nilclass/162396>\
**Category:** Rails\
**Created:** [March 9, 2009, 4:04pm UTC](https://www.ruby-forum.com/t/actionmailer-typeerror-cant-dup-nilclass/162396 "2009-03-09T16:04:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![spacechurro](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/d2c977/32.png) [@spacechurro](https://www.ruby-forum.com/u/spacechurro)\
**Post date:** [March 9, 2009, 4:04pm UTC](https://www.ruby-forum.com/t/actionmailer-typeerror-cant-dup-nilclass/162396/1 "2009-03-09T16:04:06Z")

</div>

i am currently writing a mailer, and running into several problems  
that i have not run into before…

suddenly, rails is asking me for the following:

ActionView::ActionViewError (Due to changes in ActionMailer, you need to  
provide the mailer\_name along with the template name.

i have changed my my file model to look like this:

,----[notifier]  
| class Notifier \< ActionMailer::Base  
| def files\_expiring(user\_id)  
| recipients ‘removed\_email\_address@domain.invalid’  
| bcc “removed\_email\_address@domain.invalid”  
| from “removed\_email\_address@domain.invalid”  
| subject “some subject”  
| render :file =\> “notifier/expire\_files”  
| end  
| end  
`----

when i run this, everything seems to be okay, but i get the following  
error:

,----[error message]  
| \>\> Notifier.deliver\_files\_expiring(25)  
| Notifier.deliver\_files\_expiring(25)  
| TypeError: can’t dup NilClass  
| from /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action\_view/template\_error.rb:11:in `dup' | from /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_view/template_error.rb:11:in`initialize’  
| from /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action\_view/base.rb:322:in `new' | from /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:322:in`render\_file’  
| from /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action\_view/base.rb:348:in `render' | from /Library/Ruby/Gems/1.8/gems/actionmailer-2.0.2/lib/action_mailer/base.rb:502:in`render’  
| from /Users/sergio/Sites/file\_manager/app/models/notifier.rb:7:in `files_expiring' | from /Library/Ruby/Gems/1.8/gems/actionmailer-2.0.2/lib/action_mailer/base.rb:410:in` **send** ’  
| from /Library/Ruby/Gems/1.8/gems/actionmailer-2.0.2/lib/action\_mailer/base.rb:410:in `create!' | from /Library/Ruby/Gems/1.8/gems/actionmailer-2.0.2/lib/action_mailer/base.rb:403:in`initialize’  
| from /Library/Ruby/Gems/1.8/gems/actionmailer-2.0.2/lib/action\_mailer/base.rb:352:in `new' | from /Library/Ruby/Gems/1.8/gems/actionmailer-2.0.2/lib/action_mailer/base.rb:352:in`method\_missing’  
| from (irb):41  
`----

at this point, the view has only some text in it, no reference to any  
variables…

any help would be greatly appreciated…

thanks!
