Laravel Dusk错误:无法连接到本地主机端口9515:连接被拒绝 [英] Laravel Dusk error: Failed to connect to localhost port 9515: Connection refused

查看:266
本文介绍了Laravel Dusk错误:无法连接到本地主机端口9515:连接被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如标题所述,我已经全新安装了Laravel 5.4和最新的Homestead(1.0.1).但是,当我运行一个简单的Dusk测试用例时,出现以下错误:

As the title says, I've go a clean install of Laravel 5.4 and the latest Homestead (1.0.1). However, when I run a simple Dusk test case I get the following error:

无法连接到本地主机端口9515:连接被拒绝

Failed to connect to localhost port 9515: Connection refused

有人知道如何处理吗?我尝试将端口更改为诸如8888之类的其他端口,但无济于事.

Anyone know how to deal with this? I tried changing the port to something else such as 8888 to no avail.

我已经进行了更深入的研究,发现chromedriver可执行文件实际上不是可执行文件(chmod).现在,我已经修复了手动尝试运行该错误的错误.

I've been able to dig a little deeper and found out that the chromedriver executable was not actually executable (chmod). Now that I've fixed that I get this error when I manually try to run it.

./chromedriver:加载共享库时出错:libnss3.so:无法打开共享库文件:没有这样的文件或目录

./chromedriver: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory

推荐答案

我今天遇到了这个问题,解决方案在

I had this issue today and the solution is on Laracasts.

这是副本.

# makes sure all your repos are up to date
sudo apt-get update

# chrome dependencies I think
sudo apt-get -y install libxpm4 libxrender1 libgtk2.0-0 libnss3 libgconf-2-4

# chromium is what I had success with on Codeship, so seemed a good option
sudo apt-get install chromium-browser

# XVFB for headless applications
sudo apt-get -y install xvfb gtk2-engines-pixbuf

# fonts for the browser
sudo apt-get -y install xfonts-cyrillic xfonts-100dpi xfonts-75dpi xfonts-base         xfonts-scalable

# support for screenshot capturing
sudo apt-get -y install imagemagick x11-apps

# Once all this has run through, you need to fire up xvfb on your homestead box. If you’re planning to # do this on a regular basis, you’ll want to get this setup on boot, but for the sake of testing things out:
Xvfb -ac :0 -screen 0 1280x1024x16 &

这篇关于Laravel Dusk错误:无法连接到本地主机端口9515:连接被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆