Updating a site from Radiant 0.6.9 to 0.7.1

nelstrom edited this page Aug 24, 2010 · 2 revisions
Clone this wiki locally

The transition from Radiant 0.6.x to 0.7.x has a few potential pitfalls. This article lists the straightforward upgrade instructions, followed by a troubleshooting section, which includes common errors and their workarounds.

The simple upgrade path

The following instructions are taken from the release notes for Radiant 0.7.1

  1. To install use the gem command (with ‘sudo’ as necessary):
    gem install radiant
  2. Change the RADIANT_GEM_VERSION constant in config/environment.rb to “0.7.1” or remove it altogether.
  3. Update the Radiant assets in your project:
    rake radiant:update
  4. Copy your customizations back into config/environment.rb, if necessary.
  5. Migrate the database:
    rake production db:migrate
  6. Restart the server


Problem: RSpec problems

When you run rake radiant:update, you see something like:

can't activate rspec (= 1.1.12, runtime), already activated rspec-1.2.0

Solution: Ensure you have no rspec versions greater than 1.1.12

If you have any versions of rspec newer than 1.1.12, you will have to uninstall them. Run the following to see which versions of rspec you have:

gem list | grep rspec

If this were to output, for example:

rspec (1.2.6, 1.2.4, 1.1.3, 1.1.12, 1.1.1)

Then you should run the following commands:

sudo gem uninstall rspec -v=1.2.6
sudo gem uninstall rspec -v=1.2.4
sudo gem uninstall rspec -v=1.1.3

Try running rake radiant:update again. You should no longer see the error message concerning RSpec (although you may run into one of the other problems listed here).

When you successfully run rake radiant:update, you should be able to reinstall the newer versions of RSpec again.

Problem: Extensions in conflict with Radiant 0.7

When you run rake radiant:update, you see something like:

rake radiant:update --trace
rake aborted!
uninitialized constant Admin::PageController

Solution: Ensure that your Extensions are 0.7 compatible

Many extensions were broken by changes in version 0.7 of Radiant. Extension developers were advised to ‘tag’ their extensions as 0.6.9, before fixing them to work with version 0.7. For each extension you have installed in your 0.6.9 site, check to see if it has been updated to work with 0.7. If there is a version for 0.7, then install that in place of your existing 0.6 version.

Some extensions will not have been affected by the update from 0.6 to 0.7. If you are unsure whether an extension is safe for 0.7, take a look inside the /app/controllers directory. If there are controllers with names like page_controller_extensions (note in particular, that page is singular), then it is probably not ready for 0.7.

Problem: System claims that Radiant gem is not installed

When you try to start the server, or run any rake task, the following is output:

Missing the Radiant 0.7.1 gem. Please `gem install -v=0.7.1 rails`, 
update your RADIANT_GEM_VERSION setting in config/environment.rb 
for the Rails version you do have installed, or comment out 
RADIANT_GEM_VERSION to use the latest version installed.

Even though running gem list shows that you have the Radiant 0.7.1 gem installed.

Solution: Unpack the Radiant gem into your vendor directory

By unpacking the gem into the vendor directory, we can force Radiant to boot up using that specific version, rather than by loading the gem from the usual path. This workaround has some resemblance to the practice of running Radiant on edge, except we’ll be using a stable version, instead of the bleeding edge.

cd vendor
gem unpack radiant -v=0.7.1
# this creates a directory called radiant-0.7.1
# rename it
mv radiant-0.7.1/ radiant/

You should now be able to run rake tasks and restart your server without seeing a message about “Missing the Radiant 0.7.1 gem”.