I use bundler in one of my gems to do exactly the same (test against different versions of rails).<div>You can have two different gemfiles, e.g. Gemfile.rails.2.3.8 and Gemfile.rails.3.0.0, and then use the BUNDLE_GEMFILE env to specify the gemfile to use, with bundle exec, for example</div>
<div><br></div><div> BUNDLE_GEMFILE=Gemfile.rails.2.3.8 bundle exec rake test</div><div><br></div><div>Hope that helps</div><div>Mark<br><br><div class="gmail_quote">On 12 October 2010 13:45, Glenn Gillen <span dir="ltr"><<a href="mailto:glenn@rubypond.com">glenn@rubypond.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div style="word-wrap:break-word">And then be sure to use "bundler exec" before the commands to make sure you're running the expected version of rake.<div>
<br></div><div>Or just make it easier on yourself and install bundler-exec (<a href="http://github.com/gma/bundler-exec" target="_blank">http://github.com/gma/bundler-exec</a>) as well.</div><div><div></div><div class="h5">
<div><br><div><div>On 12/10/2010, at 1:31 PM, Anthony Eden wrote:</div><br><blockquote type="cite">Andy,<div><br></div><div>I highly suggest using rvm for managing the current ruby version and gem sets. It will save you *huge* amounts of time and generally is a pleasure to use.</div>
<div><br></div><div>-Anthony<br><br><div class="gmail_quote">
On Tue, Oct 12, 2010 at 2:29 PM, Andrew Stewart <span dir="ltr"><<a href="mailto:boss@airbladesoftware.com" target="_blank">boss@airbladesoftware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hola El Rug,<br>
<br>
I would like to test my gem, which is a Rails plugin, against specific versions of Rails (e.g. 2.3.8 and 3.0.0). Before I installed Rails 3 I could run `rake test` successfully. Now, however, rake fails because it wants to activate different versions of actionpack:<br>
<br>
<a href="http://gist.github.com/622093" target="_blank">http://gist.github.com/622093</a><br>
<br>
You can reproduce this problem, if you have both Rails 3.0.0 and 2.3.8 installed, like this:<br>
<br>
$ git clone git://<a href="http://github.com/airblade/paper_trail.git" target="_blank">github.com/airblade/paper_trail.git</a><br>
$ cd paper_trail<br>
$ rake test<br>
<br>
What changes do I need to make to my gemspec/Rakefile/test_helper to be able to `rake test` against a specific version of Rails? And should I be specifying my dependencies with Bundler instead?<br>
<br>
Here's the code itself: <a href="http://github.com/airblade/paper_trail" target="_blank">http://github.com/airblade/paper_trail</a><br>
<br>
Many thanks.<br>
<br>
Cheers,<br>
<br>
Andy Stewart<br>
-------<br>
<a href="http://airbladesoftware.com/" target="_blank">http://airbladesoftware.com</a><br>
_______________________________________________<br>
Chat mailing list<br>
<a href="mailto:Chat@lists.lrug.org" target="_blank">Chat@lists.lrug.org</a><br>
<a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org" target="_blank">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>GMU/IT d- s: a33 C++(++++)$ UL@ P--- L+(++) !E W+++$ !N o? K? w--- !O M++ V PS+ PE Y PGP t+ !5 X- R tv b++ DI+ D++ G- e++ h---- r+++ y++++**<br><br><a href="http://anthony.mp/" target="_blank">http://anthony.mp</a><br>
</div>
_______________________________________________<br>Chat mailing list<br><a href="mailto:Chat@lists.lrug.org" target="_blank">Chat@lists.lrug.org</a><br><a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org" target="_blank">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a><br>
</blockquote></div><br></div></div></div></div><br>_______________________________________________<br>
Chat mailing list<br>
<a href="mailto:Chat@lists.lrug.org">Chat@lists.lrug.org</a><br>
<a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org" target="_blank">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Mark Evans<br>New Bamboo<br><a href="mailto:mark@new-bamboo.co.uk">mark@new-bamboo.co.uk</a><br>Tel: +44 7828 182336<br>Skype: mark-new-bamboo<br>
</div>