Hi Guys,
I am having some issues with ActionMailer in a new project I am
working on.
I am getting the following message:
“Due to changes in ActionMailer you need to provide the mailer_name as
well as the template name”
That seemed simple enough, but it doesn’t work.
The problem I see is similar to this:
http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/517ff90aa97a11a2/b89fef43b89c3e51?lnk=gst&q=render_message#b89fef43b89c3e51
I am also using Acts_As_Authenticated.
I have tried commenting out the rails_gem_version as suggested in the
above post.
When I create an email using
body “some text goes here”
I get the email fine.
So I tried to render the email using:
render “user_notifier/signup_notification”
I get the following error
can’t convert Symbol into String
trace log
c:/ruby/lib/ruby/gems/1.8/gems/actionmailer-2.0.2/lib/action_mailer/
base.rb:498:in delete' c:/ruby/lib/ruby/gems/1.8/gems/actionmailer-2.0.2/lib/action_mailer/ base.rb:498:in
render’
app/models/user_notifier.rb:7:in signup_notification' c:/ruby/lib/ruby/gems/1.8/gems/actionmailer-2.0.2/lib/action_mailer/ base.rb:410:in
send’
c:/ruby/lib/ruby/gems/1.8/gems/actionmailer-2.0.2/lib/action_mailer/
base.rb:410:in create!' c:/ruby/lib/ruby/gems/1.8/gems/actionmailer-2.0.2/lib/action_mailer/ base.rb:403:in
initialize’
c:/ruby/lib/ruby/gems/1.8/gems/actionmailer-2.0.2/lib/action_mailer/
base.rb:352:in new' c:/ruby/lib/ruby/gems/1.8/gems/actionmailer-2.0.2/lib/action_mailer/ base.rb:352:in
method_missing’
app/models/user_observer.rb:5:in after_create' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ observer.rb:157:in
send’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/
observer.rb:157:in update' c:/ruby/lib/ruby/1.8/observer.rb:185:in
notify_observers’
c:/ruby/lib/ruby/1.8/observer.rb:184:in each' c:/ruby/lib/ruby/1.8/observer.rb:184:in
notify_observers’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/
callbacks.rb:338:in notify' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ callbacks.rb:302:in
callback’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/
callbacks.rb:227:in create_without_timestamps' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ timestamp.rb:29:in
create’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/
base.rb:2238:in create_or_update_without_callbacks' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ callbacks.rb:213:in
create_or_update’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/
base.rb:1972:in save_without_validation' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ validations.rb:934:in
save_without_transactions’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/
transactions.rb:108:in save' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ connection_adapters/abstract/database_statements.rb:66:in
transaction’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/
transactions.rb:80:in transaction' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ transactions.rb:100:in
transaction’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/
transactions.rb:108:in save' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ transactions.rb:120:in
rollback_active_record_state!’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/
transactions.rb:108:in save' app/controllers/user_controller.rb:22:in
create’
vendor/plugins/streamlined/lib/streamlined/controller/callbacks.rb:
16:in execute' vendor/plugins/streamlined/lib/streamlined/controller/callbacks.rb: 20:in
execute_before_create_and_yield’
app/controllers/user_controller.rb:22:in create' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ base.rb:1158:in
send’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/
base.rb:1158:in perform_action_without_filters' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ filters.rb:697:in
call_filters’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/
filters.rb:689:in perform_action_without_benchmark' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ benchmarking.rb:68:in
perform_action_without_rescue’
c:/ruby/lib/ruby/1.8/benchmark.rb:293:in measure' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ benchmarking.rb:68:in
perform_action_without_rescue’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/
rescue.rb:199:in perform_action_without_caching' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ caching.rb:678:in
perform_action’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/
connection_adapters/abstract/query_cache.rb:33:in cache' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ query_cache.rb:8:in
cache’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/
caching.rb:677:in perform_action' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ base.rb:524:in
send’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/
base.rb:524:in process_without_filters' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ filters.rb:685:in
process_without_session_management_support’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/
session_management.rb:123:in process' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ base.rb:388:in
process’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/
dispatcher.rb:171:in handle_request' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ dispatcher.rb:115:in
dispatch’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/
dispatcher.rb:126:in dispatch_cgi' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ dispatcher.rb:9:in
dispatch’
c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:
112:in handle_dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in
service’
c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in
run’
c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in
start’
c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in
start’
c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in each' c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in
start’
c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in start' c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in
start’
c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in
dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/ webrick.rb:66 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
gem_original_require’
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/ dependencies.rb:496:in
require’
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/
dependencies.rb:342:in new_constants_in' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/ dependencies.rb:496:in
require’
c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
require’
script/server:3
***** end trace*******
If I try using
render :file=>“user_notifier/signup_notification”
I get the following error
can’t dup NilClass
********* trace log ***********
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/
template_error.rb:11:in dup' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/ template_error.rb:11:in
initialize’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/
base.rb:322:in new' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/ base.rb:322:in
render_file’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/
base.rb:348:in render_without_streamlined' vendor/plugins/streamlined/lib/streamlined/view/render_methods.rb: 24:in
render’
c:/ruby/lib/ruby/gems/1.8/gems/actionmailer-2.0.2/lib/action_mailer/
base.rb:502:in render' app/models/user_notifier.rb:7:in
signup_notification’
c:/ruby/lib/ruby/gems/1.8/gems/actionmailer-2.0.2/lib/action_mailer/
base.rb:410:in __send__' c:/ruby/lib/ruby/gems/1.8/gems/actionmailer-2.0.2/lib/action_mailer/ base.rb:410:in
create!’
c:/ruby/lib/ruby/gems/1.8/gems/actionmailer-2.0.2/lib/action_mailer/
base.rb:403:in initialize' c:/ruby/lib/ruby/gems/1.8/gems/actionmailer-2.0.2/lib/action_mailer/ base.rb:352:in
new’
c:/ruby/lib/ruby/gems/1.8/gems/actionmailer-2.0.2/lib/action_mailer/
base.rb:352:in method_missing' app/models/user_observer.rb:5:in
after_create’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/
observer.rb:157:in send' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ observer.rb:157:in
update’
c:/ruby/lib/ruby/1.8/observer.rb:185:in notify_observers' c:/ruby/lib/ruby/1.8/observer.rb:184:in
each’
c:/ruby/lib/ruby/1.8/observer.rb:184:in notify_observers' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ callbacks.rb:338:in
notify’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/
callbacks.rb:302:in callback' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ callbacks.rb:227:in
create_without_timestamps’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/
timestamp.rb:29:in create' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ base.rb:2238:in
create_or_update_without_callbacks’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/
callbacks.rb:213:in create_or_update' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ base.rb:1972:in
save_without_validation’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/
validations.rb:934:in save_without_transactions' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ transactions.rb:108:in
save’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/
connection_adapters/abstract/database_statements.rb:66:in
transaction' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ transactions.rb:80:in
transaction’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/
transactions.rb:100:in transaction' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ transactions.rb:108:in
save’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/
transactions.rb:120:in rollback_active_record_state!' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ transactions.rb:108:in
save’
app/controllers/user_controller.rb:22:in create' vendor/plugins/streamlined/lib/streamlined/controller/callbacks.rb: 16:in
execute’
vendor/plugins/streamlined/lib/streamlined/controller/callbacks.rb:
20:in execute_before_create_and_yield' app/controllers/user_controller.rb:22:in
create’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/
base.rb:1158:in send' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ base.rb:1158:in
perform_action_without_filters’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/
filters.rb:697:in call_filters' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ filters.rb:689:in
perform_action_without_benchmark’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/
benchmarking.rb:68:in perform_action_without_rescue' c:/ruby/lib/ruby/1.8/benchmark.rb:293:in
measure’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/
benchmarking.rb:68:in perform_action_without_rescue' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ rescue.rb:199:in
perform_action_without_caching’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/
caching.rb:678:in perform_action' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ connection_adapters/abstract/query_cache.rb:33:in
cache’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/
query_cache.rb:8:in cache' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ caching.rb:677:in
perform_action’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/
base.rb:524:in send' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ base.rb:524:in
process_without_filters’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/
filters.rb:685:in process_without_session_management_support' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ session_management.rb:123:in
process’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/
base.rb:388:in process' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ dispatcher.rb:171:in
handle_request’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/
dispatcher.rb:115:in dispatch' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ dispatcher.rb:126:in
dispatch_cgi’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/
dispatcher.rb:9:in dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb: 112:in
handle_dispatch’
c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:78:in
service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in
service’
c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in run' c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in
start_thread’
c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in start' c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in
start_thread’
c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in start' c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in
each’
c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in start' c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in
start’
c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in start' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb:62:in
dispatch’
c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/
webrick.rb:66
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
require’
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/
dependencies.rb:496:in require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/ dependencies.rb:342:in
new_constants_in’
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/
dependencies.rb:496:in require' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
gem_original_require’
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require’
script/server:3
end trace*******
I’m not even sure where to look to solve this one. If any further
info is needed (code etc) please let me know. I didn’t want to make
the post too massive.
Your help is much appreciated.
~Ben