Skip to content
This repository has been archived by the owner on Nov 27, 2020. It is now read-only.

Absolute paths can no longer be used to find the phantomjs binary #389

Closed
ollyw opened this issue Sep 6, 2013 · 6 comments
Closed

Absolute paths can no longer be used to find the phantomjs binary #389

ollyw opened this issue Sep 6, 2013 · 6 comments

Comments

@ollyw
Copy link

ollyw commented Sep 6, 2013

Since poltergeist has been changed to use Cliver (1df2d5d), absolute paths do not work with the :phantomjs option. Cliver appears to only accept the name of a binary, and fails when a full path is passed in.

This causes problems because in our dev environment, both locally and on CI servers, phantomjs is a custom version that is not on the path. Currently I am using windows, but I don't think it will work on unix either.

If this behaviour is by design (i.e. the behaviour has changed intentionally), then the documentation needs updating, as the documentation states ":phantomjs (String) - A custom path to the phantomjs executable", which is no longer correct. However, the option to pass a full path in was very useful!

@route
Copy link
Contributor

route commented Sep 6, 2013

@yaauie could you take a look?

@yaauie
Copy link
Contributor

yaauie commented Sep 11, 2013

@ollyw hm. Cliver is supposed to work nicely with absolute paths. Can you give me the exact string (path) you're passing in so I can verify? This may be a bug in how Cliver works on Windows.

Also, the raised exception's message would be very helpful here. Feel free to scrub whatever parts you need to, but leave as much in-tact as you can. If needed, it can be sent securely to me via PGP (ryan@yaauie.com my pubkey).

@ollyw
Copy link
Author

ollyw commented Sep 12, 2013

Poltergeist used to work with relative paths, and the path was '.\lib\phantom\phantomjs.exe'. That now fails. If subsequently used with an absolute path that fails too (just a path on the C drive). The problem can easily be illustrated with notepad on windows. In the following IRB session, it detects notepad on the path, but when I feed the absolute path back into cliver it doesn't seem to work.

irb(main):002:0> require 'cliver'
=> true
irb(main):003:0> Cliver.detect('notepad')
=> "C:/Windows/system32/notepad.exe"
irb(main):004:0> Cliver.detect('C:/Windows/system32/notepad.exe')
=> nil
irb(main):005:0> Cliver.detect('C:\Windows\system32\notepad.exe')
=> nil
irb(main):006:0> Cliver.detect('/C/Windows/system32/notepad.exe')
=> nil

I am fairly new to windows path handling in Ruby, so if I am missing anything obvious, let me know. BTW, I am using ruby 1.9.3p374 (2013-01-15) [i386-mingw32] on Windows 7. It is also interesting that none of the cliver examples in http://rubydoc.info/gems/cliver/0.2.1/frames use absolute paths as input to detect.

@route
Copy link
Contributor

route commented Sep 12, 2013

We have to take about windows platform, sounds legit.

@yaauie
Copy link
Contributor

yaauie commented Sep 17, 2013

I'll find and fix this bug upstream in Cliver tonight.

@yaauie
Copy link
Contributor

yaauie commented Sep 18, 2013

@ollyw can you upgrade your cliver to v0.2.2 and tell me if the problem is resolved? I don't have a Windows box on which to test, and @travis-ci doesn't support Windows quite yet, but I think that it should be fixed. Please re-open yaauie/cliver#6 and follow up there if it is not resolved.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants