Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A RubyGems plugin for patching gems

branch: master

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 test
Octocat-spinner-32 LICENCE
Octocat-spinner-32 rakefile.rb


A RubyGems plugin that patches gems.


gem-patch is a RubyGems plugin that helps to patch gems without manually opening and rebuilding them. It opens a given .gem file, extracts it, patches it with system patch command, clones its spec, updates the file list and builds the patched gem.


Run gem install gem-patch and you are done.


On Fedora you can use YUM:

sudo yum install rubygem-gem-patch


gem patch [options] name-version.gem PATCH [PATCH ...]

Supported options

option alternative syntax description
-pNUMBER --strip-numberNUMBER Sets the file name strip count to NUMBER.
-FNUMBER --fuzz=NUMBER Set NUMBER of lines to ignore in looking for places to install a hunk.
-oFILE --output=FILE Set output FILE.
--dry-run Print the results from patching, but do not change any files.
--verbose Print additional info and STDOUT from patch command.

For versions higher than 0.1.4 --dry-run switch behaviour has been changed and it's not the same as in original patch command. Instead, gem-patch lets patch command modify files, but doesn't override the gem to be patched nor the output file at the end. This way we can easily use dry run also for patches involving more diffs changing each other.


This version is build for both RubyGems 1.8 and RubyGems 2.0.


Released under the MIT license. Feel free to contribute!

Something went wrong with that request. Please try again.