From: Jeffrey Chan Date: 2012-09-08T02:14:42+09:00 Subject: Re: How to patch ruby's gem before an install ? --e89a8ff1ca5a4c9a5a04c91fbee1 Content-Type: text/plain; charset=UTF-8 Why not just clone/fork it from GitHub, apply your patch and commit it, then use bundler to install the gem using the :git => syntax? gem 'gosu', :git => 'git://github.com/yourname/gosu.git' , or gem 'gosu', :git => '/myproject/src/gosu.git' (if it's on your hard drive) I'm a bit for a Ruby noob but have modified gems this way myself several times, very easy. Gosu has native code in C++ so not sure if that affects it. If the above syntax fails, you can try running the Rakefile included in the source to build the gem package locally. - Jeff On Sat, Sep 8, 2012 at 12:25 AM, David Unric wrote: > Hi, > > got stuck and cann't find appropriate guide how can I patch gem package > before it gets installed. > > For example I'm trying to fix gem for Gosu library: > > 1. download the gem with "gem fetch gosu" > 2. extract contents of the gem with "gem unpack gosu-0.7.45.gem" > 3. apply a patch: cd gosu-0.7.45 && patch -p1 > /path/to/patch/fix_cflags.patch > 4. ??? how to rebuild a gem from modified sources ? I cann't find the > original gemspec. > 5. ??? install modified gem with gem install ./gosu-0.7.45.gem > > Any idea ? > > Thx, David > > -- > Posted via http://www.ruby-forum.com/. > > --e89a8ff1ca5a4c9a5a04c91fbee1 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Why not just clone/fork it from GitHub, apply your patch and commit it, the= n use bundler to install the gem using the :git =3D> syntax?

=C2=A0 =C2=A0gem 'gosu', :git =3D> 'git://github.com/yourname/gosu.git' = , or
=C2=A0 =C2=A0gem 'gosu', :git =3D> '/myproject/src/gosu= .git' =C2=A0(if it's on your hard drive)

I'm = a bit for a Ruby noob but have modified gems this way myself several times,= very easy. Gosu has native code in C++ so not sure if that affects it. If = the above syntax fails, you can try running the Rakefile included in the so= urce to build the gem package locally.

- Jeff



--e89a8ff1ca5a4c9a5a04c91fbee1--