Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some systems failing to resolve version? #10

Closed
yaauie opened this issue Nov 20, 2013 · 9 comments
Closed

Some systems failing to resolve version? #10

yaauie opened this issue Nov 20, 2013 · 9 comments

Comments

@yaauie
Copy link
Owner

yaauie commented Nov 20, 2013

@mschuerig opened teampoltergeist/poltergeist#415 with the following:


Here's what I get:

irb(main):009:0> phantomjs_path = Cliver.detect('phantomjs', '~> 1.8', '>= 1.8.1')
=> nil
irb(main):010:0> phantomjs_path = Cliver.detect('phantomjs', '~> 1.8')
=> nil
irb(main):011:0> phantomjs_path = Cliver.detect('phantomjs', '>= 1.8.1')
=> "/usr/bin/phantomjs"
irb(main):012:0> `#{phantomjs_path} --version`.chomp
=> "1.9.0"

Also of interest:

irb(main):013:0> Cliver::VERSION
=> "0.2.2"
irb(main):016:0> RUBY_DESCRIPTION
=> "ruby 1.9.3p448 (2013-06-27 revision 41675) [x86_64-linux]"

The system is a current Debian unstable/sid with phantomjs package 1.9.0-1.


I cannot repro this in 0.2.2 or the current 0.3.1:

 phantomjs_path = Cliver.detect!('phantomjs', '~>1.8', '>=1.8.1')
# => "/usr/local/bin/phantomjs"
`#{phantomjs_path} --version`.chomp
# => "1.9.0"

@mschuerig can you try the Cliver.detect! method? It'll raise an informative exception when the dependency cannot be met.

@yaauie
Copy link
Owner Author

yaauie commented Nov 20, 2013

@mschuerig Since we use rubygems Gem::Requirement#satisfied_by? which is Ruby stdlib, your version of Ruby would be really helpful in debugging this.

@mschuerig
Copy link

irb(main):013:0> Cliver::VERSION
=> "0.2.2"
irb(main):016:0> RUBY_DESCRIPTION
=> "ruby 1.9.3p448 (2013-06-27 revision 41675) [x86_64-linux]"

The system is a current Debian unstable/sid with phantomjs package 1.9.0-1. However, ruby as well as them gems are installed with rvm.

Here's the exception I get with Cliver.detect!

irb(main):001:0> require 'cliver'
=> true
irb(main):002:0> phantomjs_path = Cliver.detect!('phantomjs', '~> 1.8', '>= 1.8.1')
Cliver::Dependency::VersionMismatch: Could not find an executable 'phantomjs' that matched the requirements '~> 1.8', '>= 1.8.1'. Found versions were {"/usr/bin/phantomjs"=>"65"}.

@yaauie
Copy link
Owner Author

yaauie commented Nov 21, 2013

65? That's odd. I think you may be hitting a bug (#5) that was resolved in cliver-0.3.x, which now favors stdout explicitly.

In jonleighton/poltergeist, I have pushed a commit that upgrades the cliver dependency to a more recent version. Can you tell me if that fixes it? If so, what is your console output of phantomjs --version 2>&1 (which forces stderr onto stdout)?

@mschuerig
Copy link

That version works correctly:

irb(main):002:0> Cliver::VERSION
=> "0.3.1"
irb(main):003:0> phantomjs_path = Cliver.detect!('phantomjs', '~> 1.8', '>= 1.8.1')
=> "/usr/bin/phantomjs"

Thanks!

@yaauie
Copy link
Owner Author

yaauie commented Nov 21, 2013

Sweet. Thanks for working with me on that, and my apologies for the frustration.

@yaauie yaauie closed this as completed Nov 21, 2013
@cayblood
Copy link

I'm getting a similar error with 0.3.1 on ubuntu precise:

Could not find an executable 'phantomjs' that matched the requirements '~> 1.8', '>= 1.8.1'. Found versions were {"/usr/bin/phantomjs"=>"2013"}. (Cliver::Dependency::VersionMismatch)

Any idea why the version string is by year instead of normal?

@yaauie
Copy link
Owner Author

yaauie commented Dec 12, 2013

@cayblood: can you give me the STDOUT and STDERR from the /usr/bin/phantomjs --version command? I'd be willing to guess that your package manager is adding some build information to the output that is colliding with cliver's search for a version number.

To get only STDOUT, do:
/usr/bin/phantomjs --version 2>/dev/null

To get only STDERR do:
/usr/bin/phantomjs --version 2>&1 >/dev/null

Once you do that, I'll open up a separate bug & solve it asap.

@yaauie
Copy link
Owner Author

yaauie commented Dec 13, 2013

@cayblood I've created #11 to track progress on this, and have a small work-in-progress locally. I've also released v0.3.2, which adds a way to avoid cliver version verification by setting the environment variable CLIVER_NO_VERIFY (see diff)

@cayblood
Copy link

Sorry for the delay here. The output from /usr/bin/phantomjs --version had an error message in it which was causing cliver parse errors. I fixed it by installing a different version of phantomjs on my system.

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

No branches or pull requests

3 participants