How to install binary gem without the build step?
Hello,
I need to install binary gem. However, the gem is not compatible with my platform, so I need to patch it before build. I would appreciate if there would be some way how to skip the build and build the binary extension later manually. This would allow to generate folder structure, documentation and the spec file as well as to prevent the error exit code of gem install
Vit
Support Staff 2 Posted by Luis Lavena on 06 May, 2011 12:49 PM
Hello,
There is no functionality for gem installation.
However, you can do the following:
gem fetchto download the gem packagegem unpackto extract the gemEdit the gem to generate the modifications you need
Then use
gem specand save the contents as gem.gemspec which you can use withgem buildto regenerate the gem.But, I would recommend you reach our the gem author and collaborate to introduce the changes to the gem directly :-)
Luis Lavena closed this discussion on 06 May, 2011 12:49 PM.
Support Staff 3 Posted by Luis Lavena on 06 May, 2011 12:50 PM
Forgot to mention,
From the generated gemspec, remove the
extensionspart so the new gem do not attempt to compile again.Vít Ondruch re-opened this discussion on 09 May, 2011 12:40 PM
4 Posted by Vít Ondruch on 09 May, 2011 12:40 PM
Thank you Luis, I am aware that something like the guide you have written is probably the way, but you see how many steps and hassle is required. Compare it with following fictional steps:
This ticket was aimed more to be RFE then request for the guide.
I understand and fully support, that it is better to work with upstream to support my platform, but on the other hand, to help upstream to support my platform, it would be nice to have such feature in place. I can create RFE ticket somewhere, but not sure where. Probably Rubyforge?
Support Staff 5 Posted by Luis Lavena on 09 May, 2011 01:21 PM
Well, actually that will not work.
mkmf generates paths to be installed into site_ruby, not inside the gem, so make and make install will place the generated extension outside the gem itself. RubyGems patches the generated makefile to place the result in lib, something you will require to do manually.
RubyGems tracker is here:
http://rubyforge.org/tracker/?group_id=126
It is mentioned in RubyGems README:
https://github.com/rubygems/rubygems
I still recommend working with upstream.