Project

General

Profile

Redmine Contracts with Time Tracking with Rails 5.1.6 and Redmine 3.1.4

Added by Mathieu f over 6 years ago

Hi,

I'm trying to install the plugin "Redmine Contracts with Time Tracking" but I have some struggles.

Here are my informations:
- Ruby 2.5.1p57
- Rails 5.1.6
- Ubuntu 16.04 Xenial
- Database used: MySQL 14.14
- Webrick.

The author details the installation steps as follow:
Option 1 - Download zip
- For Redmine 3 download the zip https://github.com/upgradeya/redmine-contracts-with-time-tracking-plugin/archive/master.zip
- For Redmine 2 download this zip https://github.com/upgradeya/redmine-contracts-with-time-tracking-plugin/archive/v1.3.1.zip
- Unzip the redmine-contracts-with-time-tracking-plugin-master folder, rename it to contracts, and place it in the redmine plugins folder.
- run 'rake redmine:plugins:migrate RAILS_ENV=production' from your redmine root directory

Following those steps, I encountered a first problem when I ran the rake redmine:plugins.. command:
rake aborted!
NoMethodError: undefined method `to_prepare' for ActionDispatch::Callbacks:Class

I found a solution with this link: https://github.com/ruby-grape/grape/issues/1666
"Rails 5.1 removed ActionDispatch::Callbacks#to_prepare (see rails/rails@3f2b7d6); so the issue lies in your reload_api.rb initializer. Replacing it with ActiveSupport::Reloader.to_prepare should fix the issue."

Then ran the rake command again, and this time the error that appears is:

rake aborted!
NoMethodError: undefined method `after_filter' for TimelogController:Class
Did you mean? after_action
/home/mathieu/code/redmine-test/plugins/contracts/lib/contracts/patches/timelog_controller_patch.rb:8:in `block in included'
/home/mathieu/code/redmine-test/plugins/contracts/lib/contracts/patches/timelog_controller_patch.rb:7:in `class_eval'
/home/mathieu/code/redmine-test/plugins/contracts/lib/contracts/patches/timelog_controller_patch.rb:7:in `included'
/home/mathieu/code/redmine-test/plugins/contracts/init.rb:42:in `include'
/home/mathieu/code/redmine-test/plugins/contracts/init.rb:42:in `block in <top (required)>'
/home/mathieu/code/redmine-test/config/environment.rb:14:in `<top (required)>'
Tasks: TOP => redmine:plugins:migrate => environment
(See full trace by running task with --trace)

Any idea how to get over this? And if someone had already seen these errors installing this plugin, what else did you have to modify?

Thanks for your help.
Mathieu


Replies (1)

RE: Redmine Contracts with Time Tracking with Rails 5.1.6 and Redmine 3.1.4 - Added by Mathieu f over 6 years ago

Hi,found the problem.

In plugins/cintratcs/lib/contracts/patches/timelog_controller_patch.rb:
Modify after_filter by after_action (after_filter not supported on RoR 5.1.x).

Cheers.

    (1-1/1)