我想申请在这个线程中提到的action_mailer补丁,但我以前从来没有在应用补丁程序,我不知道如何将这些工作: https://rails.lighthouseapp.com/projects/8994/tickets/2263

我的行动邮件的宝石是在这里:/opt/ruby-enterprise-1.8.6-20090421/lib/ruby/gems/1.8/gems/actionmailer-2.3.2

我想我需要去到该目录并运行补丁命令......这样的事情?

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”

有帮助吗?

解决方案

您通常不希望修补宝石源本身。你可能会想冻结的宝石成${RAILS_ROOT}/vendor/rails,然后本地应用修补程序。

从$ {RAILS_ROOT}目录,倾倒所有轨宝石为供应商/轨道

rake rails:freeze:gems

应用补丁

  cd vendor/rails/ 
  patch -p1 < 0001-Fix-implicit-multipart-mailer-views-when-RAILS_ROOT.patch

其他提示

Micholson的回答上述作品。但是,修补所有Rails应用实际的创业板(看到我对他的回答评论)这工作:

cd /opt/ruby-enterprise-1.8.6-20090421/lib/ruby/gems/1.8/gems/actionmailer-2.3.2
wget sudo wget https://rails.lighthouseapp.com/attachments/108548/0001-Fix-implicit-multipart-mailer-views-when-RAILS_ROOT.patch
sudo patch -p2 < 0001-Fix-implicit-multipart-mailer-views-when-RAILS_ROOT.patch
sudo rm 0001-Fix-implicit-multipart-mailer-views-when-RAILS_ROOT.patch

我发现你也可以逆转与-R一个补丁,如果有什么差错。我很惊讶,这个过程没有更好的地方记录。希望这将在谷歌搜索掉头向上人们新的修补和我一样。

下面是一个壳状的衬垫用于修补一个宝石:

  

patch -d "$(gem env gemdir)"/gems/actionmailer-* -p1 < <(curl -s https://rails.lighthouseapp.com/attachments/108548/0001-Fix-implicit-multipart-mailer-views-when-RAILS_ROOT.patch)

使用gist宝石又如:

  

patch -d "$(gem env gemdir)"/gems/gist-* -p1 < <(curl -s https://github.com/defunkt/gist/commit/5843e9827f529cba020d08ac764d70c8db8fbd71.patch)

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top