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

Andrew Stewart boss at airbladesoftware.com
Tue Oct 12 05:29:18 PDT 2010


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



More information about the Chat mailing list