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?

4

1 に答える 1

1

[編集2]

あなたはあなたが setnotifiers :offではないnotification :offと言いました(私はいつもオプションと混同されています、私自身)。

また、ガードはlibnotify ここでそれを要求することで「検出」します。つまり、システムのどこかにファイルがあることを意味します。

(ファイルがない場合、require は LoadError で失敗し、Guard は libnotify が利用できないと判断します)。

strace を実行してその場所を特定する「強引な」方法の 1 つ (サーバーで利用できるはずです):

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

私にとっては次のことを示しています:

[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

注: システム ruby​​ がインストールされている可能性があります。これは次の方法で確認できます。

rvm use system
gem list libnotify

ガードは、gem がどこかにインストールされている (または、どこかにベンダー製の gem がある) という単純な理由で不平を言っています。

于 2014-12-17T01:17:54.583 に答える