从contab运行phantomjs时出现错误“QStandardPaths:XDG_RUNTIME_DIR未设置,默认为'/ tmp / runtime-mizu'”

时间:2018-01-22 05:38:41

标签: cron phantomjs

当我使用crontab运行phantomJS时,会发生以下错误。我怎样才能成功运行它?我使用的是Ubuntu 17.10。

[错误]

QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-mizu'
QXcbConnection: Could not connect to display 
PhantomJS has crashed. Please read the bug reporting guide at
<http://phantomjs.org/bug-reporting.html> and file a bug report.
Aborted (core dumped)

[crontab的]

*/1 * * * *  /home/mizu/phantomjs /home/mizu/script.js 

1 个答案:

答案 0 :(得分:0)

“ QStandardPaths:XDG_RUNTIME_DIR未设置”不是错误。而是警告您未指定此环境变量,因此Qt选择了它自己的位置来建立商店。只要它是可写的(应该是可写的),那应该没问题。

因此,问题更可能是“ QXcbConnection:无法连接到显示器”。还有一个类似的错误 error: XDG_RUNTIME_DIR not set in the environment. Gtk-WARNING **: cannot open display: 这表明您可能在结转环境变量时遇到问题。

相关问题