如何在路轨上的红宝石上贴上补丁? [英] How do you apply a patch to ruby on rails?
问题描述
我想应用此线程中提到的action_mailer修补程序,但是我以前从未应用过该修补程序,而且我不确定它们是如何工作的: https://rails.lighthouseapp.com/projects/8994/tickets/2263
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
我的动作邮件程序gem在这里:/opt/ruby-enterprise-1.8.6-20090421/lib/ruby/gems/1.8/gems/actionmailer-2.3.2
My action mailer gem is here: /opt/ruby-enterprise-1.8.6-20090421/lib/ruby/gems/1.8/gems/actionmailer-2.3.2
我认为我需要进入该目录并运行patch命令...类似这样的东西?
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
我还不清楚的一件事是,补丁文件指向"actionmailer"目录,而我的被称为"actionmailer-2.3.2"
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"
推荐答案
您通常不希望修补gem资源本身.您可能希望将宝石冻结到${RAILS_ROOT}/vendor/rails
中,然后在本地应用补丁.
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.
从您的$ {RAILS_ROOT}目录中,将所有rails gem都转储到供应商/rails中
From your ${RAILS_ROOT} dir, dump all of your rails gems into vendor/rails
rake rails:freeze:gems
应用补丁
cd vendor/rails/
patch -p1 < 0001-Fix-implicit-multipart-mailer-views-when-RAILS_ROOT.patch
这篇关于如何在路轨上的红宝石上贴上补丁?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!