I'd like to apply the action_mailer patch mentioned in this thread but I have never applied a patch before and I'm not sure how these work: https://rails.lighthouseapp.com/projects/8994/tickets/2263
My action mailer gem is here: /opt/ruby-enterprise-1.8.6-20090421/lib/ruby/gems/1.8/gems/actionmailer-2.3.2
I assume I need to go to that directory and run the patch command...something like this?
cd /opt/ruby-enterprise-1.8.6-20090421/lib/ruby/gems/1.8/gems/
wget https://rails.lighthouseapp.com/attachments/108548/0001-Fix-implicit-multipart-mailer-views-when-RAILS_ROOT.patch
patch < 0001-Fix-implicit-multipart-mailer-views-when-RAILS_ROOT.patch
One thing I'm not really clear on also is that the patch file refers to the "actionmailer" directory but mine is called "actionmailer-2.3.2"
Micholson's answer above works. But to patch the actual gem for all rails apps (see my comment on his answer) this worked:
I found out you can also reverse a patch with -R if anything goes wrong. I'm surprised this process wasn't better documented somewhere. Hopefully this will turn up in Google searches for people new to patching like me.
You typically don't want to patch the gem source itself. You probably will want to freeze the gems into
${RAILS_ROOT}/vendor/rails
, and then apply the patch locally.From your ${RAILS_ROOT} dir, dump all of your rails gems into vendor/rails
Apply the patch
Here is a shell one-liner for patching a gem:
Another example using
gist
gem: