首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >guard找不到libnotify,也无法禁用通知,但抛出错误

guard找不到libnotify,也无法禁用通知,但抛出错误
EN

Stack Overflow用户
提问于 2014-12-05 19:22:49
回答 1查看 531关注 0票数 0

guard一直运行得很好,直到它突然抛给我一堆错误:

代码语言:javascript
复制
$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命令(缩写):

代码语言:javascript
复制
  +-------------------+-----------+------+-----------+-------------------+
  | libnotify         | ✔         | ✘    | transient | false             |
  |                   |           |      | append    | true              |
  |                   |           |      | timeout   | 3                 |
  +-------------------+-----------+------+-----------+-------------------+
  | notifysend        | ✘         | ✘    | t         | 3000              |
  |                   |           |      | h         | "int:transient:1" |
  +-------------------+-----------+------+-----------+-------------------+
  | terminal_title    | ✔         | ✘    |           |                   |
  +-------------------+-----------+------+-----------+-------------------+
  | file              | ✘         | ✘    | format    | "%s\n%s\n%s\n"    |
  +-------------------+-----------+------+-----------+-------------------+

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

我正在运行ubuntu服务器,所以我想我不应该有libnotify,为什么卫兵突然对我这么粗鲁?

EN

回答 1

Stack Overflow用户

发布于 2014-12-17 09:17:55

EDIT2

你提到你设置的是notifiers :off,而不是notification :off (我自己总是把选项混在一起)。

此外,guard 'detects‘libnotify by requiring it here -这意味着你在系统的某个地方有这个文件。

(如果没有文件,则请求失败并返回LoadError,并且Guard判定libnotify不可用)。

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

代码语言:javascript
复制
strace -f -e open bundle exec guard notifiers 2>&1 | /bin/grep -v 'ENOENT' |/bin/grep lib/libnotify.rb

对我来说这说明了:

代码语言:javascript
复制
[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

注:您可能安装了系统红宝石,您可以使用以下命令进行检查:

代码语言:javascript
复制
rvm use system
gem list libnotify

Guard抱怨很简单,因为gem被安装在某个地方(或者在某个地方有一个供应商提供的gem )。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/27314809

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档