bitcrowd / herodot

Track your work with your git activity.
MIT License
12 stars 0 forks source link

`add_entry': undefined method `gsub' for nil:NilClass #11

Closed bitboxer closed 6 years ago

bitboxer commented 6 years ago

I am seeing this error on my machine:

/var/lib/gems/2.4.0/gems/herodot-0.2.0/lib/herodot/worklog.rb:15:in `add_entry': undefined method `gsub' for nil:NilClass (NoMethodError)
    from /var/lib/gems/2.4.0/gems/herodot-0.2.0/lib/herodot/parser.rb:28:in `block in parse_into_worklog'
    from /usr/lib/ruby/2.4.0/csv.rb:1771:in `each'
    from /usr/lib/ruby/2.4.0/csv.rb:1148:in `block in foreach'
    from /usr/lib/ruby/2.4.0/csv.rb:1299:in `open'
    from /usr/lib/ruby/2.4.0/csv.rb:1147:in `foreach'
    from /var/lib/gems/2.4.0/gems/herodot-0.2.0/lib/herodot/parser.rb:25:in `parse_into_worklog'
    from /var/lib/gems/2.4.0/gems/herodot-0.2.0/lib/herodot/parser.rb:11:in `parse'
    from /var/lib/gems/2.4.0/gems/herodot-0.2.0/lib/herodot/commands.rb:14:in `show'
    from /var/lib/gems/2.4.0/gems/herodot-0.2.0/lib/herodot.rb:68:in `block (2 levels) in show_command'
    from /var/lib/gems/2.4.0/gems/commander-4.4.3/lib/commander/command.rb:178:in `call'
    from /var/lib/gems/2.4.0/gems/commander-4.4.3/lib/commander/command.rb:153:in `run'
    from /var/lib/gems/2.4.0/gems/commander-4.4.3/lib/commander/runner.rb:446:in `run_active_command'
    from /var/lib/gems/2.4.0/gems/commander-4.4.3/lib/commander/runner.rb:68:in `run!'
    from /var/lib/gems/2.4.0/gems/commander-4.4.3/lib/commander/delegates.rb:15:in `run!'
    from /var/lib/gems/2.4.0/gems/herodot-0.2.0/lib/herodot.rb:26:in `run'
    from /var/lib/gems/2.4.0/gems/herodot-0.2.0/exe/herodot:6:in `<top (required)>'
    from /usr/local/bin/herodot:23:in `load'
    from /usr/local/bin/herodot:23:in `<main>'
andreasknoepfle commented 6 years ago

Hi @bitboxer

Can you attach a anonymized worklog with which one can reproduce this issue? Or also describe what you did so far with herodot?

I'm going to have a look at it anyway, but being able to reproduce this upfront would help a lot.

bitboxer commented 6 years ago

Will try tonight when I am back at my machine

andreasknoepfle commented 6 years ago

@bitboxer Seems that you had an empty .herodot.yml file in your ~/.Or at least the key for projects_directory is wrong or missing. The PR should make it more robust and go back to the defaults, but maybe this already helps to fix the issue you have.

bitboxer commented 6 years ago

Ah, perfekt. Thanks!