0

守卫运行良好,直到突然出现,它给我带来了这些错误:

$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>

这是一个guard notifiers命令(缩短):

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

我尝试notifiers :off在 Guardfile 中设置选项,卸载 libnotify gem,但没有效果。

我正在运行 ubuntu 服务器,所以我认为我不应该有 libnotify,为什么警卫突然对我如此粗鲁?

4

1 回答 1

1

[编辑2]

你提到你 set notifiers :off,而不是notification :off(我自己一直与选项混淆)。

libnotify 此外,通过在此处要求它来保护“检测” - 这意味着您在系统的某个位置拥有该文件。

(如果没有文件,请求失败并出现 LoadError 并且 Guard 决定 libnotify 不可用)。

通过运行 strace 找出它在哪里的一种“蛮力”方法(应该在服务器上可用):

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

注意:您可能安装了系统红宝石,您可以通过以下方式检查:

rvm use system
gem list libnotify

Guard 抱怨只是因为 gem 安装在某处(或者某处有一个出售的 gem。

于 2014-12-17T01:17:54.583 回答