linux - 带有 Slimerjs 的 CasperJS - Xlib : extension "RANDR" missing on display ":99"

标签 linux centos casperjs xvfb slimerjs

我正在尝试使用 Slimerjs 运行 Casperjs

  • 我安装了 SlimerJS 0.10.2
  • 我已经安装了 Mozilla Firefox 45.5.1(也尝试过 50)
  • 我已经安装了 CasperJS 1.1.3
  • 我已经安装了xvfb 1.17.4

在 Centos 6.8 上运行

当尝试从 php 运行 casperjs+slimerjs 时,我得到:

Gecko error: it seems /usr/bin/firefox is not compatible with SlimerJS.
See Gecko version compatibility. If version is correct, launch slimerjs
with --debug=true to see Firefox error message

当我尝试使用 debug=true 从控制台运行脚本时,例如: /usr/local/bin/casperjs/tmp/casperjs-5cn484 --debug=true --engine=slimerjs (我也尝试过 xvfb-run)

我收到这个错误:

Xlib:  extension "RANDR" missing on display ":99".
process 5588: D-Bus library appears to be incorrectly set up; failed to read machine uuid: Failed to open "/var/lib/dbus/machine-id": No such file or directory
See the manual page for dbus-uuidgen to correct this issue.
  D-Bus not built with -rdynamic so unable to print a backtrace
Redirecting call to abort() to mozalloc_abort

/usr/lib/node_modules/slimerjs/src/slimerjs: line 167:  5588 Segmentation fault      "$SLIMERJSLAUNCHER" -app "$SLIMERDIR/application.ini" $PROFILE -no-remote "$@"

如果我运行 slimerjs --debug=true,我得到:

错误:无法打开显示::1.1 Gecko 错误:/usr/bin/firefox 似乎与 SlimerJS 不兼容。 请参阅 Gecko 版本兼容性。如果版本正确,启动 slimerjs 使用 --debug=true 查看 Firefox 错误消息

我已经尝试了很多解决方案,例如:

  • 尝试过:Xvfb :1 -screen 0 1024x768x24 +extension RANDR &export DISPLAY=:1(也有 :99)
  • 尝试了 export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/
  • 升级降级火狐版本
  • 检查是否有字体,有一个,所以没问题

我不知道我在尝试什么,有什么建议吗? :)

最佳答案

无论如何,我让它运行安装 dbus 包并使用命令:

dbus-uuidgen > /var/lib/dbus/machine-id

Xlib: extension "RANDR"missing on display ":99" 不是大问题...

来自: http://www.torkwrench.com/2011/12/16/d-bus-library-appears-to-be-incorrectly-set-up-failed-to-read-machine-uuid-failed-to-open-varlibdbusmachine-id/

关于linux - 带有 Slimerjs 的 CasperJS - Xlib : extension "RANDR" missing on display ":99",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41131177/

相关文章:

bash - 需要 bash 函数中的循环建议

java - CentOS 与 postgresql 的连接被拒绝

javascript - 在 js 文件上运行 casperjs 时“找不到模块 fs”

javascript - CasperJS 单击与选择器匹配的所有链接

c - Linux 上的最大子进程数

linux - Bash 脚本在前一个命令之前运行一个命令。我想要一个接一个

构建目录中的 Linux 内核 modules.builtin 与内核不匹配

linux - 在 Linux 中使用仅限 CLI 的工具生成磁盘使用情况图/图表

centos - 在 CentOS 6.6 上安装 Marklogic 8.0 时出现 glibc 2.11 错误

javascript - 需要在同步 CasperJS 中运行 for 循环和 WaitFor