Radiant-comments-extension install glitch

Hi:

New to blogging, I installed Radiant on Tuesday. I’m running 0.7.0-rc2
(http://radiantcms.org/blog/archives/2009/01/21/radiant-0-7-0-rc2-available/)
with Postgres on Ubuntu Hardy. The basic site is up and running without
a glitch.

But when I tried to install radiant-comments-extension, I got the error
below. Any thoughts would sure be appreciated.

The extension is partially installed. I see the “Comments” tab in
/admin, and there are three comment-related snippets. But the “Comments”
tab links to http://www.jameslavin.com/admin/comments/unapproved, which
displays an “Application error” page.

A second (possibly related) question is where I should be installing the
extension… in
/usr/lib/ruby/gems/1.8/gems/radiant-0.7.0/vendor/extensions or
~/public_html/jameslavin.com.

(I’m suspicious of this line in the stack trace:
/usr/lib/ruby/gems/1.8/gems/radiant-0.7.0/app/models/radiant/config.rb:34:in
`[]')

Thank you for taking time to look at this!

–James Lavin

“rake radiant:extensions:comments:update --trace” produces…

(in /home/jkl/public_html/jameslavin.com)
** Invoke radiant:extensions:comments:update (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
PGError: ERROR: relation “config” does not exist
: SELECT a.attname, format_type(a.atttypid, a.atttypmod),
d.adsrc, a.attnotnull
FROM pg_attribute a LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = ‘config’::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum
/usr/lib/ruby/gems/1.8/gems/radiant-0.7.0/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:147:in
log' /usr/lib/ruby/gems/1.8/gems/radiant-0.7.0/vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:471:in query’
/usr/lib/ruby/gems/1.8/gems/radiant-0.7.0/vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:983:in
column_definitions' /usr/lib/ruby/gems/1.8/gems/radiant-0.7.0/vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:616:in columns’
/usr/lib/ruby/gems/1.8/gems/radiant-0.7.0/vendor/rails/activerecord/lib/active_record/base.rb:1149:in
columns' /usr/lib/ruby/gems/1.8/gems/radiant-0.7.0/vendor/rails/activerecord/lib/active_record/base.rb:1162:in column_names’
/usr/lib/ruby/gems/1.8/gems/radiant-0.7.0/vendor/rails/activerecord/lib/active_record/base.rb:1175:in
column_methods_hash' /usr/lib/ruby/gems/1.8/gems/radiant-0.7.0/vendor/rails/activerecord/lib/active_record/base.rb:1719:in all_attributes_exists?’
/usr/lib/ruby/gems/1.8/gems/radiant-0.7.0/vendor/rails/activesupport/lib/active_support/dependencies.rb:216:in
all?' /usr/lib/ruby/gems/1.8/gems/radiant-0.7.0/vendor/rails/activerecord/lib/active_record/base.rb:1719:in each’
/usr/lib/ruby/gems/1.8/gems/radiant-0.7.0/vendor/rails/activerecord/lib/active_record/base.rb:1719:in
all?' /usr/lib/ruby/gems/1.8/gems/radiant-0.7.0/vendor/rails/activerecord/lib/active_record/base.rb:1719:in all_attributes_exists?’
/usr/lib/ruby/gems/1.8/gems/radiant-0.7.0/vendor/rails/activerecord/lib/active_record/base.rb:1618:in
method_missing' /usr/lib/ruby/gems/1.8/gems/radiant-0.7.0/app/models/radiant/config.rb:34:in []’
/home/jkl/public_html/jameslavin.com/vendor/extensions/comments/comments_extension.rb:59:in
activate' /home/jkl/public_html/jameslavin.com/vendor/extensions/comments/comments_extension.rb:59:in each’
/home/jkl/public_html/jameslavin.com/vendor/extensions/comments/comments_extension.rb:59:in
activate' /usr/lib/ruby/gems/1.8/gems/radiant-0.7.0/lib/radiant/extension.rb:38:in activate’
/usr/lib/ruby/gems/1.8/gems/radiant-0.7.0/vendor/rails/activesupport/lib/active_support/core_ext/symbol.rb:11:in
__send__' /usr/lib/ruby/gems/1.8/gems/radiant-0.7.0/vendor/rails/activesupport/lib/active_support/core_ext/symbol.rb:11:in to_proc’
/usr/lib/ruby/gems/1.8/gems/radiant-0.7.0/lib/radiant/extension_loader.rb:94:in
each' /usr/lib/ruby/gems/1.8/gems/radiant-0.7.0/lib/radiant/extension_loader.rb:94:in activate_extensions’
/usr/lib/ruby/gems/1.8/gems/radiant-0.7.0/lib/radiant/initializer.rb:112:in
after_initialize' /usr/lib/ruby/gems/1.8/gems/radiant-0.7.0/vendor/rails/railties/lib/initializer.rb:152:in process’
/usr/lib/ruby/gems/1.8/gems/radiant-0.7.0/vendor/rails/railties/lib/initializer.rb:97:in
send' /usr/lib/ruby/gems/1.8/gems/radiant-0.7.0/vendor/rails/railties/lib/initializer.rb:97:in run’
/usr/lib/ruby/gems/1.8/gems/radiant-0.7.0/lib/radiant/initializer.rb:91:in
run' /home/jkl/public_html/jameslavin.com/config/environment.rb:12 /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require’
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in require' /usr/lib/ruby/gems/1.8/gems/radiant-0.7.0/vendor/rails/activesupport/lib/active_support/dependencies.rb:510:in require’
/usr/lib/ruby/gems/1.8/gems/radiant-0.7.0/vendor/rails/activesupport/lib/active_support/dependencies.rb:355:in
new_constants_in' /usr/lib/ruby/gems/1.8/gems/radiant-0.7.0/vendor/rails/activesupport/lib/active_support/dependencies.rb:510:in require’
/usr/lib/ruby/gems/1.8/gems/radiant-0.7.0/vendor/rails/railties/lib/tasks/misc.rake:3
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in call' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in execute’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in each' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in execute’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:578:in
invoke_with_call_chain' /usr/lib/ruby/1.8/monitor.rb:242:in synchronize’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in
invoke_with_call_chain' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:588:in invoke_prerequisites’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:585:in each' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:585:in invoke_prerequisites’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:577:in
invoke_with_call_chain' /usr/lib/ruby/1.8/monitor.rb:242:in synchronize’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in
invoke_with_call_chain' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:564:in invoke’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2019:in invoke_task' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in top_level’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in each' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in top_level’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in
standard_exception_handling' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1991:in top_level’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1970:in run' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in standard_exception_handling’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1967:in run' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/bin/rake:31 /usr/bin/rake:19:in load’
/usr/bin/rake:19

Have you run “rake db:bootstrap” yet?

The first error says ‘relation “config” does not exist’ meaning the
config table does not exist (which would be the case if you hadn’t run
the bootstrap)

Jim G. wrote:

Have you run “rake db:bootstrap” yet?

The first error says ‘relation “config” does not exist’ meaning the
config table does not exist (which would be the case if you hadn’t run
the bootstrap)

Dear Jim:

Thanks for your reply!

I didn’t run “rake db:bootstrap” because I was following the (sparse)
directions at
http://github.com/artofmission/radiant-comments/tree/master, which make
no mention of this.

But your comment prompted me to realize that I hadn’t specified the
PRODUCTION database. I ran “rake production
radiant:extensions:comments:update --trace”, which gave no error
message. (I also then re-ran “rake production
radiant:extensions:comments:migrate”, which also gave no error message.)

Unfortunately, the “Comments” tab still links to
http://www.jameslavin.com/admin/comments/unapproved, which still
generates an “Application error” page. (Perhaps this is because I have
now installed but not yet configured the extension, but I suspect
there’s still something wrong.)

mail ~/public_html/jameslavin.com: rake production
radiant:extensions:comments:update --trace
(in /home/jkl/public_html/jameslavin.com)
** Invoke production (first_time)
** Execute production
** Invoke environment (first_time)
** Execute environment
** Invoke radiant:extensions:comments:update (first_time)
** Invoke environment
** Execute radiant:extensions:comments:update

Again, Thanks.

–James

I have the will_paginate gem (version 2.2.2) installed, but when I click
on the “Comments” tab, it can’t find method “paginate”:

Processing Admin::CommentsController#index (for 69.120.41.109 at
2009-02-06 10:53:03) [GET]

Parameters: {“status”=>“unapproved”, “action”=>“index”,
“controller”=>“admin/comments”}

NoMethodError (undefined method paginate' for #<Class:0x7f8e9c6c7b18>): /usr/lib/ruby/gems/1.8/gems/radiant-0.7.0/vendor/rails/activerecord/lib/active_record/base.rb:1672:inmethod_missing’

Update: Comments are now half working.

In /admin/pages, there’s a “comments” column, but when I click to
“Enable” an article, it generates an application error page. When I
refresh /admin/pages, the “Enable” button has changed to “0 comments.”
And the “enable_comments” column in database table “pages” was correctly
set to TRUE.

I then manually set all the “enable_comments” values to TRUE for all my
blog posts. After refreshing /admin/pages, the “Enable” buttons were all
replaced by “0 comments.”

The comment forms appear correctly. And I was able to post a test
comment. I saw it. But then it disappeared.

It see the comment in the “comments” table of the database, but the
“approved_at” and “approved_by” fields are blank.

I have no idea how to approve it because the comments-related admin
pages (including the “Contents” tab in /admin/pages, which points to
/admin/comments/unapproved) all generate application errors.

–James

James Lavin wrote:

I have the will_paginate gem (version 2.2.2) installed, but when I click
on the “Comments” tab, it can’t find method “paginate”:

After adding “config.gem “will_paginate”” to environment.rb, it seems to
be running!

Try the version from my fork:

git://github.com/seancribbs/radiant-comments.git

It is updated to work with 0.7.

Sean

P.S. Extension developers - don’t set Radiant::Config values without
checking for existence of the table! Your activate methods run on
initialization, whether the DB is bootstrapped or not.

Sean C. wrote:

Try the version from my fork:

git://github.com/seancribbs/radiant-comments.git

It is updated to work with 0.7.

Sean

Thanks for the fix, Sean. Do I still need to install the fork if almost
everything is now working properly?

Here’s what’s still failing: Clicking “Enable” to enable comments for an
article correctly changes the info in the database but then throws this
error:

Processing Admin::CommentsController#enable (for XX.XX.XX.XX at
2009-02-06 16:21:49) [GET]
Session ID: XXXXXXX
Parameters: {“action”=>“enable”, “page_id”=>“23”,
“controller”=>“admin/comments”}
Cookie set: session_token=XXXXXXXXXXXX; path=/; expires=Fri, 20 Feb 2009
21:21:49 GMT

NameError (undefined local variable or method page_index_path' for #<Admin::CommentsController:0x7f0e4b013410>): /vendor/extensions/comments/app/controllers/admin/comments_controller.rb:66:inenable’
/usr/lib/ruby/gems/1.8/gems/radiant-0.7.0/vendor/rails/actionpack/lib/action_controller/base.rb:1166:in
send' /usr/lib/ruby/gems/1.8/gems/radiant-0.7.0/vendor/rails/actionpack/lib/action_controller/base.rb:1166:inperform_action_without_filters’
/usr/lib/ruby/gems/1.8/gems/radiant-0.7.0/vendor/rails/actionpack/lib/action_controller/filters.rb:579:in
call_filters' /usr/lib/ruby/gems/1.8/gems/radiant-0.7.0/vendor/rails/actionpack/lib/action_controller/filters.rb:572:inperform_action_without_benchmark’
/usr/lib/ruby/gems/1.8/gems/radiant-0.7.0/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in
perform_action_without_rescue' /usr/lib/ruby/1.8/benchmark.rb:293:inmeasure’
/usr/lib/ruby/gems/1.8/gems/radiant-0.7.0/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in
perform_action_without_rescue' /usr/lib/ruby/gems/1.8/gems/radiant-0.7.0/vendor/rails/actionpack/lib/action_controller/rescue.rb:201:inperform_action_without_caching’
/usr/lib/ruby/gems/1.8/gems/radiant-0.7.0/vendor/rails/actionpack/lib/action_controller/caching/sql_cache.rb:13:in
passenger_orig_perform_action' /usr/lib/ruby/gems/1.8/gems/radiant-0.7.0/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:33:incache’

One of my tasks for tomorrow is to introduce a module that will contain
all of the legacy routes and their new equivalents. This will be
automatically included in the application helper and controller so the
old routes will work.

Sean

James Lavin wrote:

James Lavin wrote:

I have the will_paginate gem (version 2.2.2) installed, but when I click
on the “Comments” tab, it can’t find method “paginate”:

After adding “config.gem “will_paginate”” to environment.rb, it seems to
be running!

I tried adding that to the environment.rb file (and also
“mislav-will_paginate”), but Ray is giving me an error.

Missing these required gems:
mislav-will_paginate

I see that I have both 2.3.8 and 2.3.7 installed by running “gem list”.

What else can I do?