action mailer gem and tlsmail gem not working in heroku after GIT PUSH HEROKU
I'm using heroku as my host..It was working fine.
Then I installed action_mailer_tls and tlsmail. Then I comitted it and pushed it heroku..
After that I got error in myapp.heroku.com. The error is
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- smtp_tls (MissingSourceFile)
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /usr/local/lib/ruby/gems/1.8/gems/activesuppor开发者_如何学运维t-2.3.3/lib/active_support/dependencies.rb:158:in `require'
from /disk1/home/slugs/154378_e47562d_b59c/mnt/config/initializers/smtp_gmail.rb:3
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:147:in `load_without_new_constant_marking'
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:147:in `load'
from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.3/lib/initializer.rb:622:in `load_application_initializers'
from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.3/lib/initializer.rb:621:in `each'
from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.3/lib/initializer.rb:621:in `load_application_initializers'
... 19 levels...
from /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/builder.rb:29:in `instance_eval'
from /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/builder.rb:29:in `initialize'
from /home/heroku_rack/heroku.ru:1:in `new'
from /home/heroku_rack/heroku.ru:1
Do I need to push the gems..If so I tried
git add .gems
It also gives fatal error.
any suggestion would be greatly appreciated.
Used
rake gems:unpack
It will unpack the specified gems to vendor/gems
Add smtp_tls
in your .gems.
Yes - this is most likely (almost certainly) b/c the default ruby version on heroku is 1.8.6, and TLS support comes natively in 1.8.7.
If you're feeling brave, you can migrate your heroku app to a newer stack (see 'heroku stack' for more info)
if you are using Ruby 1.8.7 or greater, you don't need to install smtp_tls gem. It is already present. You just need to enable_starttls_auto in your config/environment.rb file
ActionMailer::Base.smtp_settings = {
:enable_starttls_auto => true,
:address => 'smtp.gmail.com',
:port => 587,
:domain => 'example.com',
:authentication => :plain,
:user_name => 'user',
:password => 'secret'
}
or
config.action_mailer.smtp_settings = {
:enable_starttls_auto => true,
:port => 587,
:address => "smtp.gmail.com",
:domain => "example.com",
:user_name => "user",
:password => "secret",
:authentication => :plain
}
please add a comment if you have any doubt related to this.
精彩评论