I’d like to change the build environment for my project to Ubuntu 14.04, but it comes with PhantomJS 2.1.1 preinstalled and that breaks many of my tests (a few more details below for anyone who’s interested).
I adapted the instructions here to install PhantomJS 1.9.8 on the Ubuntu 14.04 container but there are still some problems.
The error message I am seeing is this:
An error occurred in an after hook
Errno::EACCES: Permission denied - /home/ubuntu/bin/phantomjs
occurred at /opt/circleci/ruby/ruby-2.1.9/lib/ruby/2.1.0/open3.rb:193:in `spawn'
Here’s the commands I’m using to install PhantomJS 1.9.8:
dependencies:
pre:
- curl -L -o /home/ubuntu/bin/phantomjs-1.9.8-linux-x86_64.tar.bz2 https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.8-linux-x86_64.tar.bz2
- sudo tar -xvf /home/ubuntu/bin/phantomjs-1.9.8-linux-x86_64.tar.bz2 -C /home/ubuntu/bin
- sudo chmod -R a+x /home/ubuntu/bin/phantomjs-1.9.8-linux-x86_64
- sudo ln --force -s /home/ubuntu/bin/phantomjs-1.9.8-linux-x86_64 /home/ubuntu/bin/phantomjs
- sudo ln --force -s /home/ubuntu/bin/phantomjs/bin/phantomjs /usr/local/bin/phantomjs
- phantomjs --version
The final command demonstrates that PhantomJS 1.9.8 is installed.
That’s it for the main issue, you can stop reading now.
For anyone who’s interested, the problem I’m having with PhantomJS 2.1.1 is in a Ruby on Rails app that uses a wysihtml5
editor within a formtastic
form. Debugging indicates that the form is populated by the feature test but the Rails controller receives an empty value. It works fine with PhantomJS 1.9.8.
I’ve Googled and StackOverflowed the hell out of it but nobody else seems to be having this problem.
Stack trace for the spec failures:
# /opt/circleci/ruby/ruby-2.1.9/lib/ruby/2.1.0/open3.rb:193:in `spawn'
# /opt/circleci/ruby/ruby-2.1.9/lib/ruby/2.1.0/open3.rb:193:in `popen_run'
# /opt/circleci/ruby/ruby-2.1.9/lib/ruby/2.1.0/open3.rb:93:in `popen3'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/cliver-0.3.2/lib/cliver/shell_capture.rb:17:in `initialize'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/cliver-0.3.2/lib/cliver/detector.rb:43:in `new'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/cliver-0.3.2/lib/cliver/detector.rb:43:in `detect_version'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/cliver-0.3.2/lib/cliver/dependency.rb:190:in `call'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/cliver-0.3.2/lib/cliver/dependency.rb:190:in `detect_version'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/cliver-0.3.2/lib/cliver/dependency.rb:87:in `block in installed_versions'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/cliver-0.3.2/lib/cliver/dependency.rb:214:in `block in find_executables'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/cliver-0.3.2/lib/cliver/dependency.rb:208:in `map'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/cliver-0.3.2/lib/cliver/dependency.rb:208:in `find_executables'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/cliver-0.3.2/lib/cliver/dependency.rb:86:in `each'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/cliver-0.3.2/lib/cliver/dependency.rb:86:in `installed_versions'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/cliver-0.3.2/lib/cliver/dependency.rb:108:in `each'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/cliver-0.3.2/lib/cliver/dependency.rb:108:in `detect!'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/cliver-0.3.2/lib/cliver/dependency.rb:97:in `detect'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/cliver-0.3.2/lib/cliver.rb:35:in `detect'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/poltergeist-1.10.0/lib/capybara/poltergeist/client.rb:36:in `initialize'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/poltergeist-1.10.0/lib/capybara/poltergeist/client.rb:14:in `new'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/poltergeist-1.10.0/lib/capybara/poltergeist/client.rb:14:in `start'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/poltergeist-1.10.0/lib/capybara/poltergeist/driver.rb:44:in `client'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/poltergeist-1.10.0/lib/capybara/poltergeist/driver.rb:25:in `browser'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/poltergeist-1.10.0/lib/capybara/poltergeist/driver.rb:179:in `reset!'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/capybara-2.7.1/lib/capybara/session.rb:109:in `reset!'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/capybara-2.7.1/lib/capybara.rb:331:in `block in reset_sessions!'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/capybara-2.7.1/lib/capybara.rb:331:in `reverse_each'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/capybara-2.7.1/lib/capybara.rb:331:in `reset_sessions!'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/capybara-2.7.1/lib/capybara/rspec.rb:21:in `block (2 levels) in <top (required)>'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/rspec-core-2.99.2/lib/rspec/core/extensions/instance_eval_with_args.rb:16:in `instance_exec'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/rspec-core-2.99.2/lib/rspec/core/extensions/instance_eval_with_args.rb:16:in `instance_eval_with_args'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/rspec-core-2.99.2/lib/rspec/core/example_group.rb:622:in `instance_eval_with_rescue'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/rspec-core-2.99.2/lib/rspec/core/example.rb:236:in `instance_eval_with_rescue'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/rspec-core-2.99.2/lib/rspec/core/hooks.rb:31:in `run'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/rspec-core-2.99.2/lib/rspec/core/hooks.rb:85:in `block in run'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/rspec-core-2.99.2/lib/rspec/core/hooks.rb:85:in `each'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/rspec-core-2.99.2/lib/rspec/core/hooks.rb:85:in `run'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/rspec-core-2.99.2/lib/rspec/core/hooks.rb:446:in `run_hook'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/rspec-core-2.99.2/lib/rspec/core/example_group.rb:473:in `run_after_each_hooks'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/rspec-core-2.99.2/lib/rspec/core/example.rb:292:in `run_after_each'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/rspec-core-2.99.2/lib/rspec/core/example.rb:123:in `block in run'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/rspec-core-2.99.2/lib/rspec/core/example.rb:178:in `call'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/rspec-core-2.99.2/lib/rspec/core/example.rb:178:in `run'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/rspec-retry-0.4.0/lib/rspec/retry.rb:43:in `block (3 levels) in apply'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/rspec-retry-0.4.0/lib/rspec/retry.rb:34:in `times'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/rspec-retry-0.4.0/lib/rspec/retry.rb:34:in `block (2 levels) in apply'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/rspec-core-2.99.2/lib/rspec/core/extensions/instance_eval_with_args.rb:16:in `instance_exec'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/rspec-core-2.99.2/lib/rspec/core/extensions/instance_eval_with_args.rb:16:in `instance_eval_with_args'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/rspec-core-2.99.2/lib/rspec/core/example.rb:241:in `instance_eval_with_args'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/rspec-core-2.99.2/lib/rspec/core/hooks.rb:106:in `block (2 levels) in run'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/rspec-core-2.99.2/lib/rspec/core/hooks.rb:108:in `call'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/rspec-core-2.99.2/lib/rspec/core/hooks.rb:108:in `run'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/rspec-core-2.99.2/lib/rspec/core/hooks.rb:446:in `run_hook'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/rspec-core-2.99.2/lib/rspec/core/example_group.rb:463:in `run_around_each_hooks'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/rspec-core-2.99.2/lib/rspec/core/example.rb:250:in `with_around_each_hooks'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/rspec-core-2.99.2/lib/rspec/core/example.rb:113:in `run'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/rspec-core-2.99.2/lib/rspec/core/example_group.rb:515:in `block in run_examples'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/rspec-core-2.99.2/lib/rspec/core/example_group.rb:511:in `map'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/rspec-core-2.99.2/lib/rspec/core/example_group.rb:511:in `run_examples'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/rspec-core-2.99.2/lib/rspec/core/example_group.rb:496:in `run'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/rspec-core-2.99.2/lib/rspec/core/example_group.rb:497:in `block in run'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/rspec-core-2.99.2/lib/rspec/core/example_group.rb:497:in `map'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/rspec-core-2.99.2/lib/rspec/core/example_group.rb:497:in `run'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/rspec-core-2.99.2/lib/rspec/core/example_group.rb:497:in `block in run'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/rspec-core-2.99.2/lib/rspec/core/example_group.rb:497:in `map'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/rspec-core-2.99.2/lib/rspec/core/example_group.rb:497:in `run'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/rspec-core-2.99.2/lib/rspec/core/command_line.rb:24:in `block (2 levels) in run'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/rspec-core-2.99.2/lib/rspec/core/command_line.rb:24:in `map'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/rspec-core-2.99.2/lib/rspec/core/command_line.rb:24:in `block in run'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/rspec-core-2.99.2/lib/rspec/core/reporter.rb:58:in `report'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/rspec-core-2.99.2/lib/rspec/core/command_line.rb:21:in `run'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/rspec-core-2.99.2/lib/rspec/core/runner.rb:103:in `run'
# /home/ubuntu/xenapto/vendor/bundle/ruby/2.1.0/gems/rspec-core-2.99.2/lib/rspec/core/runner.rb:17:in `block in autorun'