siaw23 / kovid

Fetch and compare COVID statistics on the CLI.
MIT License
102 stars 15 forks source link

Argument Errors #77

Closed ckuetbach closed 4 years ago

ckuetbach commented 4 years ago

Some commands gives ArgumentErrors

~# kovid eu

Traceback (most recent call last):
        11: from /usr/local/bin/kovid:23:in `<main>'
        10: from /usr/local/bin/kovid:23:in `load'
         9: from /var/lib/gems/2.5.0/gems/kovid-0.4.10/exe/kovid:4:in `<top (required)>'
         8: from /var/lib/gems/2.5.0/gems/thor-1.0.1/lib/thor/base.rb:485:in `start'
         7: from /var/lib/gems/2.5.0/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch'
         6: from /var/lib/gems/2.5.0/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command'
         5: from /var/lib/gems/2.5.0/gems/thor-1.0.1/lib/thor/command.rb:27:in `run'
         4: from /var/lib/gems/2.5.0/gems/kovid-0.4.10/lib/kovid/cli.rb:62:in `eu'
         3: from /var/lib/gems/2.5.0/gems/kovid-0.4.10/lib/kovid.rb:14:in `eu_aggregate'
         2: from /var/lib/gems/2.5.0/gems/kovid-0.4.10/lib/kovid/request.rb:26:in `eu_aggregate'
         1: from /var/lib/gems/2.5.0/gems/kovid-0.4.10/lib/kovid/request.rb:188:in `aggregator'
/var/lib/gems/2.5.0/gems/kovid-0.4.10/lib/kovid/request.rb:188:in `merge': wrong number of arguments (given 26, expected 1) (ArgumentError)
havenwood commented 4 years ago

You're running into this with Ruby 2.5 since it wasn't until Ruby 2.6 that Hash#merge got support for multiple arguments. The Hash#merge usage here just needs to be rewritten for Ruby 2.5 support.

ckuetbach commented 4 years ago

Just need to figure out, how to update ruby to 2.6 within Ubuntu 18.04 LTS within Windows WSL :)

siaw23-retired commented 4 years ago

@ckuetbach A temporary fix will be to upgrade your Ruby to >= 2.6.0 while we work on rewriting the logic behind this.

You can use RVM in Ubuntu I think. Then you can switch versions easily.

Do you have RVM?

ckuetbach commented 4 years ago

I just installed it and ruby 2.7, and now it runs, BUT:

~$ kovid histogram de 3.20
+-------------------------------+
|              ❗️               |
+-------------------------------+
| No infections for this month. |
+-------------------------------+

Sources:
 * JHU CSSE GISand Data
 * https://www.worldometers.info/coronavirus/

I really would like this nummber were true.

siaw23-retired commented 4 years ago

You'd want to be doing this instead

kovid histogram germany 3.20

siaw23-retired commented 4 years ago

y-axis = number of cases x-axis = dates in the given month

ckuetbach commented 4 years ago

Thanks a lot, I was confusing the parmeter.

kovid check de works like kovid check germany