当我使用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 发布于 2019-02-14 23:26:02
"QStandardPaths: XDG_RUNTIME_DIR not set“不是错误。相反,它是一个警告,说明您没有指定此环境变量,因此Qt正在选择自己的位置来设置shop。只要它是可写的(它应该是可写的),这应该是可以的。
因此,问题更有可能是"QXcbConnection:无法连接到显示“。在error: XDG_RUNTIME_DIR not set in the environment. Gtk-WARNING **: cannot open display:上也有一个类似的bug,它表明您在传递环境变量时可能会遇到问题。
https://stackoverflow.com/questions/48375253
复制相似问题