Radiant Install, First Run, Heroku, etc.

Radiant Notes

This document contains notes that I took while getting Radiant up and running (initially as a gem). Here are some references:

Main Github for Radiant
Radiant CMS
Install Notes
Other Install Notes

Dependencies

sudo gem install ZenTest rspec rspec-rails cucumber webrat nokogiri

Install & First Run

sudo gem install radiant
radiant --database=sqlite3 radiant_test

could also be one of:

radiant --database [mysql|postresql|sqlite3|sqlserver|db2] path/to/proj

Create Sqlite3 Databases
For some reason, the only way I could create the sqlite3 database was to actually create a table in sqlite3. When I tried to create an empty database and save it, it would go “poof”. Here’s what I did:

sqlite3 db/radiant_dev.db
sqlite> create table dummy(stupido varchar(10));
sqlite> .tables
dummy
sqlite> .e

Then when I listed out db/ dir it showed up. Then I simply copied it as follows:

$ cp db/radiant_dev.db db/radiant_test.db
$ cp db/radiant_dev.db db/radiant_live.db

which was corresponding to the default yml file that looked like config/database.yml

development:
  adapter: sqlite3
  database: db/radiant_dev.db

test:
  adapter: sqlite3
  database: db/radiant_test.db
...etc, etc.,etc.

Of course you can change to your liking/database, remove the dummy table, etc.

However, when I try to do the next step:

$ rake development db:bootstrap

I get the following error because (at the time of this writing) radiant 0.8.1 does not work with cucumber-0.4.0.rc1:

rake aborted!
undefined method `feature_pattern=' for #<Cucumber::Rake::Task:0x1b1d068>
/Library/Ruby/Gems/1.8/gems/radiant-0.8.1/Rakefile:10

So I bitched a bit in the Radiant forums and then did a “personal patch” to the lib/tasks/cucumber.rake file (in the gem’s directory /Library/Ruby/Gems/1.8/gems/radiant-0.8.1/lib/cucumber.rake) inserting this to the fourth line just after the ‘begin’ line:

gem 'cucumber', '0.3.104'

Downloaded the specific gem:

sudo gem install cucumber --version '0.3.104'
$ gem list --local cucumber
*** LOCAL GEMS ***
cucumber (0.4.0.rc1, 0.3.104)

and then re-ran my

rake development db:bootstrap 

which worked and then:

$ ./script/server -e development

Heroku Notes

This is a dump of the pertinent history for deploying Radiant to Heroku

github heroku notes
heroku notes

heroku_notes.txt 
radiant --database sqlite3 radiant_heroku_blog
cp radiant_test/db/*.* radiant_heroku_blog/db/
cd radiant_heroku_blog/
rake development db:bootstrap
rake production db:bootstrap
vim .gems
gem list --local rdiscount
git init
git add .
git commit -a -m "first commit for heroku"
heroku create
git push heroku master
heroku db:push
heroku rename ostentatious-crumpets
git add .gitignore 
git commit -a -m "Added git ignore"
git push heroku master
heroku open

When I pushed the database up it auto-found the development db. However, to get the production database pushed up I had to do:

heroku db:push sqlite://db/production.sqlite3.db  

And then I saw my local changes on the heroku site.

Radiant Extensions

Installing Extensions

Some examples:

./script/extension install help  
./script/extension install blog
./script/extension install blog_tags

And restart the server (./script/server -e [production|development]

Comments Extension Installation
cd vendor/extensions/
git clone git://github.com/sjlombardo/radiant-comments.git
mv radiant-comments/ comments
sudo gem install mislav-will_paginate
vim comments_extension.rb and change the require to look like:  

begin
   require_dependency 'application_controller'
rescue MissingSourceFile
   require_dependency 'application'
end

rake radiant:extensions:comments:install
rake production radiant:extensions:comments:migrate 
rake radiant:extensions:comments:update  

In config/environment.rb
  config.gem 'mislav-will_paginate', :lib => 'will_paginate'

undefined tag `if_enable_comments'

undefined tag `comments'
undefined tag `if_comments'

undefined tag `if_enable_comments'

Continue Reading…

Posted by Rob Levin on Nov 15, 2009