0

guard was running fine, until out of the blue, it throws me these bunch of errors:

$bin/guard
Could not open library 'libgtkmm-2.4': libgtkmm-2.4: cannot open shared object file: No such file or directory.
Could not open library 'libgtkmm-2.4.so': libgtkmm-2.4.so: cannot open shared object file: No such file or directory.
Could not open library 'libgtkmm-2.4.so.1': libgtkmm-2.4.so.1: cannot open shared object file: No such file or directory.
Could not open library 'libgtkmm-3.0': libgtkmm-3.0: cannot open shared object file: No such file or directory.
Could not open library 'libgtkmm-3.0.so': libgtkmm-3.0.so: cannot open shared object file: No such file or directory.
Could not open library 'libgtkmm-3.0.so.1': libgtkmm-3.0.so.1: cannot open shared object file: No such file or directory
13:15:58 - INFO - Guard is using Libnotify to send notifications.
13:15:58 - INFO - Guard is using TerminalTitle to send notifications.
13:15:59 - INFO - Bundle already up-to-date
13:15:59 - INFO - Guard::Rack will now restart your app on port 9292 using development environment.
13:15:59 - INFO - Restarting Rack...
libnotify.so not found!
13:15:59 - ERROR - Guard::Rack failed to achieve its <start>, exception was:
> [#4FE305F3B849] NoMethodError: undefined method `notify_init' for #<Libnotify::API:0x97a2d18>

Here is a guard notifiers command (shortened):

  +-------------------+-----------+------+-----------+-------------------+
  | libnotify         | ✔         | ✘    | transient | false             |
  |                   |           |      | append    | true              |
  |                   |           |      | timeout   | 3                 |
  +-------------------+-----------+------+-----------+-------------------+
  | notifysend        | ✘         | ✘    | t         | 3000              |
  |                   |           |      | h         | "int:transient:1" |
  +-------------------+-----------+------+-----------+-------------------+
  | terminal_title    | ✔         | ✘    |           |                   |
  +-------------------+-----------+------+-----------+-------------------+
  | file              | ✘         | ✘    | format    | "%s\n%s\n%s\n"    |
  +-------------------+-----------+------+-----------+-------------------+

I've tried setting notifiers :off option in the Guardfile, uninstalling libnotify gem, but it had no effect.

I am running ubuntu server so I think I shouldn't have libnotify, why is guard so rude to me all of a sudden?

user3995789
  • 3,452
  • 1
  • 19
  • 35
  • 1
    Are you sure libnotify gem in uninstalled? The last line mentions Libnotify::API, so it seems to be available. – Sebastian vom Meer Dec 05 '14 at 12:10
  • How can I remove everything and start from scratch I tried, `rvm gemset empty GEMSET` and `bundle install` but that didn't work. @SebastianvomMeer – user3995789 Dec 05 '14 at 12:15

1 Answers1

1

[EDIT2]

You mentioned you set notifiers :off, not notification :off (I get mixed with the options all the time, myself).

Also, guard 'detects' libnotify by requiring it here - which means you have the file somewhere on your system.

(If there's no file, requiring fails with a LoadError and Guard decides libnotify is unavailable).

One "brute force" way to find out where it is by running strace (should be available on server):

strace -f -e open bundle exec guard notifiers 2>&1 | /bin/grep -v 'ENOENT' |/bin/grep lib/libnotify.rb

which for me shows:

[pid 16703] open("/home/me/.rvm/gems/ruby-2.1.4@guard/gems/libnotify-0.9.0/lib/libnotify.rb", O_RDONLY|O_CLOEXEC) = 7
[pid 16703] open("/home/me/.rvm/gems/ruby-2.1.4@guard/gems/libnotify-0.9.0/lib/libnotify.rb", O_RDONLY|O_CLOEXEC) = 7

NOTE: you may have system rubies installed, which you can check with:

rvm use system
gem list libnotify

Guard is complaining simply because the gem is installed somewhere (or there's a vendored gem somewhere.

Cezary Baginski
  • 2,077
  • 15
  • 14
  • I have ubuntu server, i don't have graphics such as libnotify, libgtk etc. So I don't want guard to use libnotify, but I can't disable it. – user3995789 Dec 17 '14 at 09:52
  • Put `notification(:off)` in your `Guardfile` (see: https://github.com/guard/guard#notification) – Cezary Baginski Dec 17 '14 at 11:00
  • I did put `notification :off` but guard doesn't respect that, if I do `bin/guard -n f` only then it works fine. I also tried uninstalling libnotify and guard then reinstall guard. But guard keeps complaining. It gets even mysterious that initially guard had no complaints but suddenly it threw these libnotify errors. – user3995789 Dec 17 '14 at 11:58