guard一直运行得很好,直到它突然抛给我一堆错误:
$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" |
+-------------------+-----------+------+-----------+-------------------+我尝试在Guardfile中设置notifiers :off选项,卸载libnotify gem,但没有效果。
我正在运行ubuntu服务器,所以我想我不应该有libnotify,为什么卫兵突然对我这么粗鲁?
发布于 2014-12-17 09:17:55
EDIT2
你提到你设置的是notifiers :off,而不是notification :off (我自己总是把选项混在一起)。
此外,guard 'detects‘libnotify by requiring it here -这意味着你在系统的某个地方有这个文件。
(如果没有文件,则请求失败并返回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 libnotifyGuard抱怨很简单,因为gem被安装在某个地方(或者在某个地方有一个供应商提供的gem )。
https://stackoverflow.com/questions/27314809
复制相似问题