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
-
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__)
-
Open config/environment.rb and add the following:
config.after_initialize do # ... existing stuff... require 'will_paginate' end
-
run "gem install bundler"
-
run "bundle init"
-
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"
-
Run "bundle install"
-
Run "bundle exec script/server"
Now you should be running Radiant 0.9.1 with bundler.
-
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...'
-
run "bundle install"
-
run "bundle exec rake radiant:update"
-
Make any alterations to your Gemfile and run "bundle install"
-
Run "bundle exec rake db:migrate db:migrate:extensions"
-
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]
- If you have the paperclipped extension
-
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]
- If you have the sns extension
-
Run "bundle exec script/server"
You should now be running on the latest version of Radiant
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.