Closed sappapp closed 11 years ago
did you restart your server after adding letter_opener
to the Gemfile and running bundle install
?
Yes, all of the proper steps have been taken. I've been running around in circles on this for a while.
I am also using the devise gem. Would this cause any interference?
@sappapp I don't think so. Could you please provide sample app that reproduces this issue?
I got the same problem. My app is upgraded from Rails 2 to Rails 3. In Rails 2, the gem worked normally but in Rails 3 we got with the error "RuntimeError: Invalid delivery method :letter_opener". I used the gem many times before, it works well. Any help to resolve the problem?
RuntimeError: Invalid delivery method :letter_opener
from /Users/eastagile/.rvm/gems/ruby-1.9.3-p392@myproject/gems/actionmailer-3.2.11/lib/action_mailer/delivery_methods.rb:72:in `wrap_delivery_behavior'
from /Users/eastagile/.rvm/gems/ruby-1.9.3-p392@myproject/gems/actionmailer-3.2.11/lib/action_mailer/delivery_methods.rb:84:in `wrap_delivery_behavior!'
from /Users/eastagile/.rvm/gems/ruby-1.9.3-p392@myproject/gems/actionmailer-3.2.11/lib/action_mailer/base.rb:641:in `mail'
from /Users/eastagile/.rvm/gems/ruby-1.9.3-p392@myproject/gems/sendgrid-1.2.0/lib/sendgrid.rb:168:in `mail'
from /Users/eastagile/code/myproject/app/mailers/emails.rb:964:in `full_service_signup_email'
from /Users/eastagile/.rvm/gems/ruby-1.9.3-p392@myproject/gems/actionpack-3.2.11/lib/abstract_controller/base.rb:167:in `process_action'
@hieuk09 Since I can't reproduce it could you please create a sample app that reproduces your problem? Thanks.
I couldn't reproduce it in another app ether. However, I solved this by adding
require 'letter_opener' if Rails.env.development?
into config/application.rb It seems that the gem does not automatically load.
rm -rf .bundle fixed it for me
Thanks @theuri
got the same error because I have deleted the gem from Gemfile, so add:
# Gemfile
gem 'letter_opener'
rm -rf .bundle fixed it for me
This solution works for me.
I have set the following setting in development.rb
Mailing Configuration Parameters
config.action_mailer.delivery_method = :letter_opener ActionMailer::Base.perform_deliveries = true ActionMailer::Base.raise_delivery_errors = false
Yet I am still receiving an error. Do you have any suggestions?