gpt4 book ai didi

ruby-on-rails - 守卫找不到 libnotify 也无法禁用通知但抛出错误

转载 作者:行者123 更新时间:2023-12-04 19:19:04 25 4
gpt4 key购买 nike

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" |
+-------------------+-----------+------+-----------+-------------------+

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

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

最佳答案

[编辑2]

你提到你设置notifiers :off ,而不是 notification :off (我自己总是与选项混为一谈)。

此外,守卫“检测”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

注意:您可能安装了系统 ruby ,您可以通过以下方式检查:
rvm use system
gem list libnotify

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

关于ruby-on-rails - 守卫找不到 libnotify 也无法禁用通知但抛出错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27314809/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com