Thursday, February 7, 2008

Some problems of the installation of Rails Comatose Plugin

Comatose is a very handy content management ruby on rails plugin. Here I am listing some problems that I encountered when I get Comatose running correctly. Most of them can be easily fixed by googling. It is just a quick summary just in case you get the same kinds of problems or errors as I did.

To install it:
script/plugin install http://comatose-plugin.googlecode.com/svn/trunk/comatose
script/generate comatose_migration
rake db:migrate
# add to your routes.rb:
map.comatose_admin
map.comatose_root 'pages'
script/server
# visit content admin http://localhost:3000/comatose_admin
# after add a page of name My Page
# visit it at http://localhost:3000/pages/my-page

1. Do rake db migration, get a Mysql::Error: BLOB/TEXT column 'full_path' can't have a default value. To fix it, remove ":default => ''" from the definition of column 'full_path', in the migration file db/migrate/xxx_add_comatose_support.rb

2. To start your rails app, get an error `method_missing': undefined method `comatose_admin' for #. I got this routing error after I use Active Merchant plugin, can not figure out why. Add this to environment.rb to make Comatose plugin be loaded firstly:
config.plugins = [ :comatose, :all ]

3. Install necessary plugins
./script/plugin install acts_as_tree
./script/plugin install acts_as_list

4. To customize comatose admin view
rake comatose:admin:customize

This task will copy all of admin view rthml files to app/view/comatose_admin directory of your rails app. There is a new layout file comatose_admin.rhtml. Modify this layout file to customize your admin view.

1 comment:

Maxula said...

Thanks, it works !, many problems to install this Plugin from : http://mattmccray.com/svn/rails/plugins.

But "acts_as_tree" and "acts_as_list" plugins must be installed before migration

Thanks again!
Rails 2.3.2, Ruby 1.8.6 (leopard)