我该如何设置&在Ubuntu上运行PhantomJS? [英] How can I setup & run PhantomJS on Ubuntu?

查看:99
本文介绍了我该如何设置&在Ubuntu上运行PhantomJS?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我设置了PhantomJS并将其录制到视频中: https://www.dailymotion.com/video/xnizmh_1_webcam

I set up PhantomJS and recorded it to video: https://www.dailymotion.com/video/xnizmh_1_webcam

构建说明: http://phantomjs.org/build.html

我的设置有什么问题吗?

Is there anything wrong in my setup?

设置完之后,我阅读了快速入门教程,并尝试编写这段代码

After I set it up I read the quick start tutorial and tried to write this code

phantomjs hello.js 

它给我找不到命令"错误.我该如何解决这个问题?

It gives me "command not found" error. How can I solve this problem?

推荐答案

Guidouil的回答使我处在正确的轨道上.我必须在/usr/bin/中添加一个附加的符号链接,并且对所有3个符号链接都进行了直接链接-见下文.

Guidouil's answer put me on the right track. I had to add one additional symlink to /usr/bin/, and I did direct symlinks for all 3 - see below.

我正在Ubuntu服务器Natty Narwhal上安装.

I'm installing on Ubuntu server Natty Narwhal.

这正是我所做的.

cd /usr/local/share
sudo wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-linux-x86_64.tar.bz2
sudo tar xjf phantomjs-1.9.7-linux-x86_64.tar.bz2
sudo ln -s /usr/local/share/phantomjs-1.9.7-linux-x86_64/bin/phantomjs /usr/local/share/phantomjs
sudo ln -s /usr/local/share/phantomjs-1.9.7-linux-x86_64/bin/phantomjs /usr/local/bin/phantomjs
sudo ln -s /usr/local/share/phantomjs-1.9.7-linux-x86_64/bin/phantomjs /usr/bin/phantomjs

最后,当我这样做

phantomjs -v

我得到1.9.7

如果有人发现我所做的任何问题,请告诉我.

If anyone sees any problems with what I've done, please let me know.

这篇关于我该如何设置&在Ubuntu上运行PhantomJS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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