Radiant and conflicting versions of Rspec
July 02, 2010 | Comments: 0If you are developing sites for more than one version of Radiant, you may run into version incompatibility issues with Rspec. For example, Radiant 0.7.1 requires Rspec 1.1.12, and Radiant 0.9 requires later versions. In order to use the appropriate version for each of your projects, you need to unpack the gems into the proper location of your project.
The following example assumes that your project is Radiant 0.7.1; that you have frozen radiant into your project; and that you have installed the 1.1.12 versions of rspec and rspec-rails.
cd RAILS_ROOT/vendor/radiant/vendor/plugins
gem unpack rspec -v 1.1.12
mv rspec-1.1.12 rspec
gem unpack rspec-rails -v 1.1.12
mv rspec-rails-1.1.12 rspec-rails
Now your specs will run in your 0.7.1 project, and your projects with later versions of Radiant will use the most recent version of the rspec and rspec-rails gems which you have installed.
Q.E.D.
Notes for other Rails apps
- The same thing applies for a standard Rails app, you just unpack the gems into /vendor/plugins
Notes for TextMate users
If you want to use the TextMate RSpec Bundle to run your specs:
- the RSpec bundle will look in vendor/plugins for your unpacked gems, so create symlinks:
cd RAILS_ROOT/vendor/plugins ln -s ../../vendor/radiant/vendor/plugins/rspec ln -s ../../vendor/radiant/vendor/plugins/rspec-rails - Make sure your version of RSpec.tmbundle is compatible with the version of RSpec you are running, e.g. I’m using this git commit on my Radiant 0.7.1 projects, which require RSpec 1.1.12 – 5d2551c0265b709bd13e7731e7f36cc5b8ecc57f
