# How do I apply patches from Trac?

**URL:** <https://www.ruby-forum.com/t/how-do-i-apply-patches-from-trac/152971>\
**Category:** Rails\
**Created:** [November 10, 2008, 6:08pm UTC](https://www.ruby-forum.com/t/how-do-i-apply-patches-from-trac/152971 "2008-11-10T18:08:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![msmsms](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/34f0e0/32.png) [@msmsms](https://www.ruby-forum.com/u/msmsms)\
**Post date:** [November 10, 2008, 6:08pm UTC](https://www.ruby-forum.com/t/how-do-i-apply-patches-from-trac/152971/1 "2008-11-10T18:08:42Z")

</div>

Hi,

although I found some posts about applying patches in this group, I  
did not come along with this.

I want to apply this patch: [http://dev.rubyonrails.org/ticket/10059](http://dev.rubyonrails.org/ticket/10059)

How do I apply patches in general? I read something about diff-files,  
git, patch, frozen ruby, etc., but I don’t understand the procedure. I  
would be very pleased, if you could help me.

Thank you alot!  
ms

---

<div class="post-metadata">

**Author:** ![msmsms](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/34f0e0/32.png) [@msmsms](https://www.ruby-forum.com/u/msmsms)\
**Post date:** [November 10, 2008, 6:22pm UTC](https://www.ruby-forum.com/t/how-do-i-apply-patches-from-trac/152971/2 "2008-11-10T18:22:13Z")

</div>

On 10 Nov 2008, at 17:07, ms wrote:

> would be very pleased, if you could help me.

Well for starters it’s probably a good idea to have rails frozen in  
your app’s vendor/rails.  
The patch file is just a diff between the original and the new version  
(ie a list of changes to make).  
Typically you download the diff file from trac (if there is more than  
one attachment you’ll just have to figure out whether one of the  
supersedes all others)

if you cd to vendor/rails you can then do something like

patch -p0 \< path/to/patch.diff

A long time ago i also coded up a quick hack to make this a little  
easier. The gem file is at  
[https://svn1.hosted-projects.com/fcheung/apply\_ticket/ApplyTicket-0.1.0.gem](https://svn1.hosted-projects.com/fcheung/apply_ticket/ApplyTicket-0.1.0.gem)  
Once you’ve got that installed you can just do (having cd’d to the  
copy of rails you want to patch)  
apply\_ticket 10059

and it will do all the above for you (in the case that there are  
multiple attachments available it will ask you which one you want).

Someone released some rake tasks that do the same for lighthouse but I  
can’t remember who/where they are.

Fred
