redmine_knowledgebase icon indicating copy to clipboard operation
redmine_knowledgebase copied to clipboard

Unable to install in Redmine 5.1.

Open jonc310 opened this issue 7 months ago • 5 comments

When trying to install into redmine 5.1 I get an error during migration. Error Sowed below I can do trace if more information is needed.

== 20100317201659 AddRatingsToArticles: migrating ============================= rake aborted! StandardError: An error has occurred, this and all later migrations canceled:

undefined method create_ratings_table' for ActiveRecord::Base:Class Did you mean? create_drafts_table create_viewings_table /mnt/extra/redmine/plugins/redmine_knowledgebase/db/migrate/20100317201659_add_ratings_to_articles.rb:3:in up' /mnt/extra/redmine/lib/redmine/plugin.rb:482:in up' /mnt/extra/redmine/lib/redmine/plugin.rb:518:in migrate_plugin' /mnt/extra/redmine/lib/redmine/plugin.rb:455:in migrate' /mnt/extra/redmine/lib/redmine/plugin.rb:466:in migrate' /mnt/extra/redmine/lib/tasks/redmine.rake:151:in block (3 levels) in <top (required)>' /root/.rbenv/versions/3.1.6/bin/bundle:25:in load' /root/.rbenv/versions/3.1.6/bin/bundle:25:in `

'

Caused by: NoMethodError: undefined method create_ratings_table' for ActiveRecord::Base:Class Did you mean? create_drafts_table create_viewings_table /mnt/extra/redmine/plugins/redmine_knowledgebase/db/migrate/20100317201659_add_ratings_to_articles.rb:3:in up' /mnt/extra/redmine/lib/redmine/plugin.rb:482:in up' /mnt/extra/redmine/lib/redmine/plugin.rb:518:in migrate_plugin' /mnt/extra/redmine/lib/redmine/plugin.rb:455:in migrate' /mnt/extra/redmine/lib/redmine/plugin.rb:466:in migrate' /mnt/extra/redmine/lib/tasks/redmine.rake:151:in block (3 levels) in <top (required)>' /root/.rbenv/versions/3.1.6/bin/bundle:25:in load' /root/.rbenv/versions/3.1.6/bin/bundle:25:in `

' Tasks: TOP => redmine:plugins:migrate (See full trace by running task with --trace)

jonc310 avatar Apr 21 '25 17:04 jonc310

Did you issue bundle install before running migrations?

yzzy avatar Apr 22 '25 09:04 yzzy

Yes, I had this setup with Redmine 4.x before and was in the process of setting up a new vm with Redmine 5.1 since I noticed all our plugins were now compatible up to 6.0.

jonc310 avatar Apr 22 '25 10:04 jonc310

Maybe you'll try my fork? Plugin initialization is a bit different there. git clone https://github.com/yzzy/redmine_knowledgebase.git

yzzy avatar Apr 22 '25 10:04 yzzy

I tried Alexanders first got error act_as_rated was missing and a different issues after I got that gem loaded. Then I tried your fork since it said it was good for Redmine 6 and got error I posted on github. I do have other plugins installed from redmineup and redmineX. I have attached my information page.

Image

Regards, Jon

On Tue, Apr 22, 2025 at 6:42 AM Alexander Abramov @.***> wrote:

Maybe you'll try my fork? Plugin initialization is a bit different there. git clone https://github.com/yzzy/redmine_knowledgebase.git

— Reply to this email directly, view it on GitHub https://github.com/alexbevi/redmine_knowledgebase/issues/414#issuecomment-2820915279, or unsubscribe https://github.com/notifications/unsubscribe-auth/A5Z6JPFA2ZWMBWAJLWL4ZL322YMILAVCNFSM6AAAAAB3RYEZG6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQMRQHEYTKMRXHE . You are receiving this because you authored the thread.Message ID: @.***> yzzy left a comment (alexbevi/redmine_knowledgebase#414) https://github.com/alexbevi/redmine_knowledgebase/issues/414#issuecomment-2820915279

Maybe you'll try my fork? Plugin initialization is a bit different there. git clone https://github.com/yzzy/redmine_knowledgebase.git

— Reply to this email directly, view it on GitHub https://github.com/alexbevi/redmine_knowledgebase/issues/414#issuecomment-2820915279, or unsubscribe https://github.com/notifications/unsubscribe-auth/A5Z6JPFA2ZWMBWAJLWL4ZL322YMILAVCNFSM6AAAAAB3RYEZG6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQMRQHEYTKMRXHE . You are receiving this because you authored the thread.Message ID: @.***>

jonc310 avatar Apr 23 '25 10:04 jonc310

ActiveRecord has been renamed to ApplicationRecord per this Redmine discussion.

Meanwhile, the database migration 20100317201659_add_ratings_to_articles.rb still invokes the method create_ratings_table of the deprecated ActiveRecord class.

I believe that's the cause of the reported error, which also persists in yzzy's fork https://github.com/yzzy/redmine_knowledgebase.git

Here's the implementation of the offending create_ratings_table

jimmythefung avatar Apr 24 '25 02:04 jimmythefung

Try this PR please - https://github.com/alexbevi/redmine_knowledgebase/pull/415, it should work

reshetov avatar Nov 13 '25 14:11 reshetov