tj / pomo

Ruby Pomodoro app for the command-line (time / task management)
MIT License
525 stars 53 forks source link

Growl error when pomodoro starts. #29

Closed amirrajan closed 11 years ago

amirrajan commented 11 years ago

disclaimer... using this on Windows 7, ruby 1.9.2, Growl Version 2.0.9.

I get the following error when I issue the command pomo start

error: private method `notify_info' called for Pomo::Notifier::Growl:Class. Use --trace to view backtrace

here is the trace

C:/Ruby192/lib/ruby/gems/1.9.1/gems/pomo-2.0.1/lib/pomo/notifier/growl.rb:11:in `notify': private method `notify_info' called for Pomo::Notifier::Growl:Class (NoMethodError)
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/pomo-2.0.1/lib/pomo/notifier.rb:22:in `notify'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/pomo-2.0.1/lib/pomo/task.rb:115:in `background_progress'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/pomo-2.0.1/lib/pomo/task.rb:74:in `start'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/pomo-2.0.1/bin/pomo:64:in `block (3 levels) in <top (required)>'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/pomo-2.0.1/lib/pomo/list.rb:66:in `block in find'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/pomo-2.0.1/lib/pomo/list.rb:65:in `each'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/pomo-2.0.1/lib/pomo/list.rb:65:in `each_with_index'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/pomo-2.0.1/lib/pomo/list.rb:65:in `find'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/pomo-2.0.1/bin/pomo:62:in `block (2 levels) in <top (required)>'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/commander-4.1.3/lib/commander/command.rb:180:in `call'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/commander-4.1.3/lib/commander/command.rb:180:in `call'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/commander-4.1.3/lib/commander/command.rb:155:in `run'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/commander-4.1.3/lib/commander/runner.rb:402:in `run_active_command'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/commander-4.1.3/lib/commander/runner.rb:78:in `run!'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/commander-4.1.3/lib/commander/delegates.rb:11:in `run!'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/commander-4.1.3/lib/commander/import.rb:10:in `block in <top (required)>'

when I run the command pomo start -p, I do get the command line progress bar...any ideas?

stephenmckinney commented 11 years ago

This is bug, caused by namespace issues. I should have a fix out pretty soon.

amirrajan commented 11 years ago

Cool. Let me know if there is any way I can help.

stephenmckinney commented 11 years ago

Could you reinstall pomo? This should be fixed in the 2.0.2 release.

amirrajan commented 11 years ago

Got a new error:

    C:/Ruby192/lib/ruby/gems/1.9.1/gems/pomo-2.0.2/lib/pomo/notifier/libnotify_notifier.rb:9:in `notify': uninitialized constant Pomo::Notifier::LibnotifyNotifier::Libnotify (NameError)
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/pomo-2.0.2/lib/pomo/notifier.rb:22:in `notify'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/pomo-2.0.2/lib/pomo/task.rb:115:in `background_progress'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/pomo-2.0.2/lib/pomo/task.rb:74:in `start'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/pomo-2.0.2/bin/pomo:64:in `block (3 levels) in <top (required)>'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/pomo-2.0.2/lib/pomo/list.rb:66:in `block in find'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/pomo-2.0.2/lib/pomo/list.rb:65:in `each'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/pomo-2.0.2/lib/pomo/list.rb:65:in `each_with_index'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/pomo-2.0.2/lib/pomo/list.rb:65:in `find'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/pomo-2.0.2/bin/pomo:62:in `block (2 levels) in <top (required)>'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/commander-4.1.3/lib/commander/command.rb:180:in `call'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/commander-4.1.3/lib/commander/command.rb:180:in `call'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/commander-4.1.3/lib/commander/command.rb:155:in `run'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/commander-4.1.3/lib/commander/runner.rb:402:in `run_active_command'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/commander-4.1.3/lib/commander/runner.rb:78:in `run!'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/commander-4.1.3/lib/commander/delegates.rb:11:in `run!'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/commander-4.1.3/lib/commander/import.rb:10:in `block in <top (required)>'
stephenmckinney commented 11 years ago

It sounds likes your ~/.pomorc has the following:

:notifier: libnotify

When it should have:

:notifier: growl
stephenmckinney commented 11 years ago

BTW the libnotify gem is not installed on Windows systems, hence the error. The above ~.pomorc change should fix your issue, but in the future I'll add some code so that it fails more gracefully. There should never be unexplained errors in a CLI app.

amirrajan commented 11 years ago

I made the update in my .pomorc and got a common error when you don't have cygwin installed (sadpanda):

    C:/Ruby192/lib/ruby/gems/1.9.1/gems/pomo-2.0.2/lib/pomo/task.rb:117:in `fork': fork() function is unimplemented on this machine (NotImplementedError)
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/pomo-2.0.2/lib/pomo/task.rb:117:in `background_progress'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/pomo-2.0.2/lib/pomo/task.rb:74:in `start'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/pomo-2.0.2/bin/pomo:64:in `block (3 levels) in <top(required)>'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/pomo-2.0.2/lib/pomo/list.rb:66:in `block in find'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/pomo-2.0.2/lib/pomo/list.rb:65:in `each'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/pomo-2.0.2/lib/pomo/list.rb:65:in `each_with_index'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/pomo-2.0.2/lib/pomo/list.rb:65:in `find'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/pomo-2.0.2/bin/pomo:62:in `block (2 levels) in <top(required)>'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/commander-4.1.3/lib/commander/command.rb:180:in `call'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/commander-4.1.3/lib/commander/command.rb:180:in `call'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/commander-4.1.3/lib/commander/command.rb:155:in `run'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/commander-4.1.3/lib/commander/runner.rb:402:in `run_active_command'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/commander-4.1.3/lib/commander/runner.rb:66:in `run!'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/commander-4.1.3/lib/commander/delegates.rb:11:in `run!'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/commander-4.1.3/lib/commander/import.rb:10:in `block in <top (required)>'
stephenmckinney commented 11 years ago

I'll have to look further into how Process is handled on Windows. SOON

amirrajan commented 11 years ago

Don't stress too much about it, I'm usually in OSX :-)

stephenmckinney commented 11 years ago

TL;DR Cygwin (or similar) is your best option

Pomo uses Process.fork() + Process.detach() to fork the process and keep running in the background. With *nix copy-on-write all is well but it appears the Windows kernel doesn't have the facilities to do this. Cygwin has a fork-like implementation but from the Cygwin docs:

current Windows implementations make it impossible to implement a perfectly reliable fork, and occasional fork failures are inevitable.

There doesn't seem to be an awesome solution, but here are a few options:

Closing this issue until it becomes apparant Pomo users on Windows commonly run Ruby without Cygwin installed.