[LRUG] How to test a Rails plugin gem against different versions of Rails?

Mark Evans mark at new-bamboo.co.uk
Thu Oct 14 02:25:50 PDT 2010


I use bundler in one of my gems to do exactly the same (test against
different versions of rails).
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

    BUNDLE_GEMFILE=Gemfile.rails.2.3.8 bundle exec rake test

Hope that helps
Mark

On 12 October 2010 13:45, Glenn Gillen <glenn at rubypond.com> wrote:

> And then be sure to use "bundler exec" before the commands to make sure
> you're running the expected version of rake.
>
> Or just make it easier on yourself and install bundler-exec (
> http://github.com/gma/bundler-exec) as well.
>
> On 12/10/2010, at 1:31 PM, Anthony Eden wrote:
>
> Andy,
>
> 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.
>
> -Anthony
>
> On Tue, Oct 12, 2010 at 2:29 PM, Andrew Stewart <boss at airbladesoftware.com
> > wrote:
>
>> Hola El Rug,
>>
>> 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:
>>
>> http://gist.github.com/622093
>>
>> You can reproduce this problem, if you have both Rails 3.0.0 and 2.3.8
>> installed, like this:
>>
>>    $ git clone git://github.com/airblade/paper_trail.git
>>    $ cd paper_trail
>>    $ rake test
>>
>> 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?
>>
>> Here's the code itself: http://github.com/airblade/paper_trail
>>
>> Many thanks.
>>
>> Cheers,
>>
>> Andy Stewart
>> -------
>> http://airbladesoftware.com
>> _______________________________________________
>> Chat mailing list
>> Chat at lists.lrug.org
>> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>>
>
>
>
> --
> 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++++**
>
> http://anthony.mp
>  _______________________________________________
> Chat mailing list
> Chat at lists.lrug.org
> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>
>
>
> _______________________________________________
> Chat mailing list
> Chat at lists.lrug.org
> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>
>


-- 
Mark Evans
New Bamboo
mark at new-bamboo.co.uk
Tel: +44 7828 182336
Skype: mark-new-bamboo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20101014/ddadca38/attachment-0003.html>


More information about the Chat mailing list