holidays / holidays

A collection of Ruby methods to deal with statutory and other holidays. You deserve a holiday!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Load Error : cannot load such file -- holidays/ca

jgarneau opened this issue · comments

Hi,
I'm using Redmine and the plugin "redmine_schedules" use holidays but have error :

C:\Bitnami\redmine-3.4.4-1\apps\redmine\htdocs>rake db:migrate_plugins RAILS_ENV=production
rake aborted!
LoadError: cannot load such file -- holidays/ca
C:/Bitnami/redmine-3.4.4-1/apps/redmine/htdocs/plugins/redmine_schedules/init.rb:3:in <top (required)>' C:/Bitnami/redmine-3.4.4-1/apps/redmine/htdocs/lib/redmine/plugin.rb:155:in block in load'
C:/Bitnami/redmine-3.4.4-1/apps/redmine/htdocs/lib/redmine/plugin.rb:146:in each' C:/Bitnami/redmine-3.4.4-1/apps/redmine/htdocs/lib/redmine/plugin.rb:146:in load'
C:/Bitnami/redmine-3.4.4-1/apps/redmine/htdocs/config/initializers/30-redmine.rb:21:in <top (required)>' C:/Bitnami/redmine-3.4.4-1/apps/redmine/htdocs/config/environment.rb:14:in <top (required)>'
Tasks: TOP => db:migrate_plugins => redmine:plugins:migrate => environment
(See full trace by running task with --trace)

Thank you for your help!

Hello! I would love to help but it seems like the redmine_schedules repo isn't maintained anymore. It looks like it is assuming a pretty old version of the gem but since the maintainer hasn't locked toa specific version it is trying to grab the latest version. We no longer have that file available at that location.

The problem most likely can be fixed by simply removing this line: https://github.com/bradbeattie/redmine-schedules-plugin/blob/master/init.rb#L3

The holidays gem doesn't need you to require a specific region, the region definitions will be loaded into memory automatically when you use them. Removing the line will most likely fix your issue if you are able to do so in your own fork (or let the maintainer know how to address it). Additionally, the redmine_scheduler repo really should specify a version of the gem to rely on. We adhere to semver for clarity.

Good luck! Let me know if I can be of any more help.

Thank you Phil for answer me!

I'm new to Ruby and my objective is to find a workload utilitie for Redmine (3.4.4).
The "init.rb" file have a require "holidays/ca", this file is in the "holidays\lib\generated_definitions" directory.
I have create a directory named holidays in the redmine_schedules directory with the file for my region (here ca.rb).

But the command : rake redmine:plugins:migrate RAILS_ENV=production
generated an error :

An error occurred while loading the routes definition of redmine_schedules plugin (C:/Bitnami/redmine-3.4.4-1/apps/redmine/htdocs/plugins/redmine_schedules/config/routes.rb): You should not use the `match` method in your router without specifying an HTTP method.
If you want to expose your action to both GET and POST, add `via: [:get, :post]` option.
If you want to expose your action to GET, use `get` in the router:
  Instead of: match "controller#action"
  Do: get "controller#action".

Replacing as mentionned does Redmine no more working!

Regards,

Jean-Yves Garneau

Hi @jgarneau, I am terribly sorry for not responding. No excuse from my end, just lost track. 😦

I'm sorry but I don't know why that might be happening. The issue is on the plugin/redmine side. If you still need help, my recommendation is to ask the plugin author to update to the latest holidays gem (6.5.0 as of this moment) and see if that fixes things.

Sorry I can't be more help! Good luck. Closing this since it's not a problem with the gem itself.