Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Upgrading from Radiant 0.9.1 to a 1.0 version

If you are starting from scratch, run gem install radiant and then radiant project_name. Then follow these instructions

If you are starting from version 0.8.2 you'll likely need to copy the boot.rb file from the 0.9.1 release first. https://github.com/radiant/radiant/blob/3c452e1d2f1277042f9c3e6337236eaf30ec7810/config/boot.rb

  1. Edit config/boot.rb to add this after the RAILS_ROOT definition:

     require 'thread'
     require 'rubygems'
     require 'bundler'
    
     begin
       # Set up load paths for all bundled gems
       ENV["BUNDLE_GEMFILE"] = File.expand_path("../../Gemfile", __FILE__)
       Bundler.setup
     rescue Bundler::GemNotFound
       raise RuntimeError, "Bundler couldn't find some gems." +
         "Did you run `bundle install`?"
     end
    

1.a. If you're using Ruby 1.9 (and you should) edit your script/server file and replace require File.dirname(__FILE__) + '/../config/boot' with

            require File.expand_path('../../config/boot', __FILE__)
  1. Open config/environment.rb and add the following:

     config.after_initialize do
     	# ... existing stuff...
     	
     	require 'will_paginate'
     end
    
  2. run "gem install bundler"

  3. run "bundle init"

  4. Copy dependencies from your environment.rb file to the Gemfile. For example:

     # A sample Gemfile
     source "http://rubygems.org"
    
     gem 'will_paginate', '2.3.14'
    
     # If you make any changes in this file, please run `bundle install`.
     # If new versions of your installed gems are available, run `bundle update`
    
     gem "radiant", "~> 0.9.1"
    
     # alternatively, in development
     # gem "radiant", :path => "/path/to/radiant/root"
    
     # SQLite is the default database connection but only suitable for local use
     # gem "sqlite3", "~> 1.3.4"
    
     # To use MySQL
     # gem "mysql", "~> 2.8.1"
    
     # Postgres
     # postgresql' %>gem "pg", "~> 0.11.0"
    
     # IBM DB2
     # gem "db2", "~> 2.6.2"
    
     # SQL Server
     # gem "tiny_tds"
     # gem "activerecord-sqlserver-adapter", "~> 3.1.0"
    
  5. Run "bundle install"

  6. Run "bundle exec script/server"

Now you should be running Radiant 0.9.1 with bundler.

  1. Edit your Gemfile to specify a newer Radiant version

     gem "radiant", "1.0.0"
    
             # or Radiant version with a git reference
    
     gem "radiant", :git => "git://github.com/radiant/radiant.git", :ref => '... some git hash...'
    
  2. run "bundle install"

  3. run "bundle exec rake radiant:update"

  4. Make any alterations to your Gemfile and run "bundle install"

  5. Run "bundle exec rake db:migrate db:migrate:extensions"

  6. Update your asset management

    • If you have the paperclipped extension
      • Remove vendor/extensions/paperclipped - Run "bundle exec rake radiant:extensions:clipped:initialize"
    • If you have the page_attachments extension
      • Move vendor/extensions/page_attachments to vendor/disabled/page_attachments (or remove it entirely)
      • Run "bundle exec rake radiant:extensions:clipped:migrate_from_page_attachments radiant:extensions:clipped:initialize" - Run "bundle
    • If you have the assets extension
      • Move vendor/extensions/assets to vendor/disabled/assets (or remove it entirely)
      • Run "bundle exec rake radiant:extensions:clipped:migrate_from_assets radiant:extensions:clipped:initialize"
    • If you want to keep your existing asset manager
      • Add to config/environment.rb config.ignore_extensions [:clipped]
  7. Update your JS and CSS management

    • If you have the sns extension
      • Move vendor/extension/sns to vendor/disabled/sns (or remove it entirely)
      • Run "bundle exec rake radiant:extensions:sheets:import:sns"
    • If you want to keep sns
      • Add to config/environment.rb config.ignore_extensions [:sheets]
  8. Run "bundle exec script/server"

You should now be running on the latest version of Radiant

cayblood commented Feb 2, 2012

Does radiant work with ruby 1.9.x?

Owner

saturnflyer commented Feb 2, 2012

@cayblood. yes, it should. we have 1 bug to work out, but we're testing on travis for 1.9 http://travis-ci.org/#!/radiant/radiant/jobs/607842

jayroh commented Jun 22, 2012

This works fine with 1.9.2 (haven't tried 1.9.3) but needed script/server updated where:

require File.dirname(__FILE__) + '/../config/boot'

should be changed to

require File.expand_path('../../config/boot', __FILE__)

Other than that I think this was pretty much spot on.

Owner

saturnflyer commented Jun 22, 2012

Thanks @jayroh!

bosborne commented Mar 2, 2014

Struggling to upgrade an older Web site, this looks very useful. But I'm getting an error after "bundle exec rake radiant:update", I see: "cannot load such file -- rake/gempackagetask"

Do I need to downgrade rake? It's currently 10.0.2. Thanks again.

bosborne commented Mar 2, 2014

Answering my own question here, yes, downgrading fixed that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment