tag:help.rubygems.org,2010-01-19:/discussions/problems/378-gempre_install-does-not-working-as-it-namedRubyGems.org: Discussion 2011-04-07T20:59:34Ztag:help.rubygems.org,2010-01-19:Comment/35441982010-10-28T15:22:22Z2010-10-28T15:22:22ZGem.pre_install does not working as it named<div><p>This is how pre_install and post_install are intended to work.</p></div>John Barnettetag:help.rubygems.org,2010-01-19:Comment/35441982010-10-29T01:45:40Z2010-10-29T01:45:40ZGem.pre_install does not working as it named<div><p>Hi John, thanks for your reply!</p>
<p>Is there anyway I can do to run a script(or a piece of ruby code) before the installation?</p></div>dazuibatag:help.rubygems.org,2010-01-19:Comment/35441982010-11-01T07:22:22Z2010-11-01T07:22:23ZGem.pre_install does not working as it named<div><p>Ditto for dazuiba's use case.</p></div>Hedgehogtag:help.rubygems.org,2010-01-19:Comment/35441982010-11-01T15:39:58Z2010-11-01T15:39:58ZGem.pre_install does not working as it named<div><p>For external dependencies like this, it's really better to check when your library is required instead of during installation. This makes the check more reliable for people who may vendor your gem or use it unpacked.</p>
<p>If you REALLY want to run something before your gem completely installs (and I wish you wouldn't), take a look at Gem::Specification's support for extensions.</p>
<p><a href="http://docs.rubygems.org/read/chapter/20#extensions">http://docs.rubygems.org/read/chapter/20#extensions</a></p></div>John Barnette