Monday, April 27th, 2009
Something I’ve held out on for a while now has been to switch over the settings for ActionMailer in my application(s) to point to my hosted Google apps account. I figured it was probably time to do so as piping email notifications through my comcast email account is generally, probably, a bad idea (courtesy of the “No Duh” department).
Seems like it should be rather easy, no? Just change action mailer to resemble:
ActionMailer::Base.smtp_settings = {
:address => "smtp.gmail.com",
:port => 587,
:domain => "hosteddomain.com",
:authentication => :plain,
:user_name => "account@hosteddomain.com",
:password => "omgsup3rsecret"
}
Meh. Looks easy enough, right? Except for the fact Google’s got some magic TLS authentication thing going on – you’ll run into an error in your mailers resembling Must issue a STARTTLS command first.. Enough to make you work a little harder to get the magic working.
For those of you/us that are running Ruby 1.8.7 and Rails 2.3.x the answer is rather simple – add :enable_starttls_auto => true to your smtp settings, which will result in :
ActionMailer::Base.smtp_settings = {
:enable_starttls_auto => true,
:address => "smtp.gmail.com",
:port => 587,
:domain => "hosteddomain.com",
:authentication => :plain,
:user_name => "account@hosteddomain.com",
:password => "omgsup3rsecret"
}
And for the rest of you/us (that would be me) that are still sticking with Ruby 1.8.6, there is an answer in the form of the action_mailer_tls gem. Following the readme will get you to right where you want to be – shoveling all the mail you would like into the ether that is the interwebs.
Tags: email, gmail, google, rails, ruby, smtp
Posted in Site Work, Web Development, internet | No Comments »
Monday, February 16th, 2009
What a huge pain in the ass.I just spent hours trying to get every combination of these two to work together and nothing worked. A handful of versions of libmemcached had no problems installing – .24, .25 and .26 were all easy to install, both from source and from macports. However, getting the memcached gem to install proved to be way way more difficult.I tried with a myriad of options – the most promising piece of information looked to be from this gentleman’s website – but also proved fruitless.The final solution, after a LOT of googling and clicking around the rubygem forums – this post at Evan Weaver’s blog. The libmemcached-0.25.14.tar.gz and memcached-0.13.gem tarball and gem, respectively, installed easily without any problems. After downloading all I had to run was:
tar -xzvf libmemcached-0.25.14.tar.gzcd libmemcached-0.25.14./configure && make && sudo make installcd ..sudo gem install memcached --no-rdoc --no-ri
Done.Finally.Update: There seems to be a few issues with the gem I link to being installed correctly in Snow Leopard. After spending too much time trying to figure out why the gem wouldn’t install, I installed the current memcached gem (from gemcutter) on a whim – and it compiled, and worked, without a problem instantly. So, if you’re running Snow Leopard and looking to install the memcached gem, try out the latest version first.One caveat – I’m still using the memcached server I linked to above, version 0.25.14, still from Evan Weaver’s site
Tags: development, gem, memcached, rails, ruby on rails, Work
Posted in Web Development, Whining, Work | 2 Comments »