Using
Ubuntu 16.04
Ruby 2.0.0
(gem) cucumber (1.3.20)
(gem) cucumber-rails (1.4.2)
Initially I had
Could not find an executable ["phantomjs"] on your path. (Cliver::Dependency::NotFound)
Which was fixed with https://stackoverflow.com/a/31333531/849697
And then
Could not find an executable 'phantomjs' that matched the requirements '>= 1.8.1', '< 3.0'. Found versions were {"/usr/bin/phantomjs"=>"127.0.0.1"}. (Cliver::Dependency::VersionMismatch)
Which bizarrely seems to be giving the ip address where ought to be a version.
phantomjs and phantomjs --version both give
QXcbConnection: Could not connect to display 127.0.0.1:10.0
PhantomJS has crashed. Please read the bug reporting guide at
<http://phantomjs.org/bug-reporting.html> and file a bug report.
[1] 1919 abort (core dumped) phantomjs --version
(there is no --version in the former)
By installing phantomjs directly after downloading from bitbucket, phantomjs --version works, and tests are running and passing as expected.
https://bitbucket.org/ariya/phantomjs/downloads -> download, extract the phantomjs executable file, sudo mv it to overwrite /usr/bin/phantomjs which was installed through sudo apt-get install phantomjs
edit: previously I was doing this workaround:
xvfb-run --auto-servernum bundle exec cucumber
xvfb is a display server, to install sudo apt-get install xvfb
Related
I'm on debian. I have ruby set up with bundle. I do
sudo gem install watir-webdriver
sudo gem install phantomjs
Then I add both to my Gemfile. Then I do bundle install. Then I run ruby code
Watir::Browser.new(:phantomjs)
and get this error:
/var/lib/gems/2.1.0/gems/selenium-webdriver-2.52.0/lib/selenium/webdriver/phantomjs/service.rb:38:in `executable_path': Unable to find phantomjs executable. (Selenium::WebDriver::Error::WebDriverError)
How do I make this work? Thanks!
you don't have phantomjs installed correctly (or at all), so when your program tries to open phantomjs, it cant find it.
try this
http://www.netdip.com/install-phantomjs-1422766836/
You may install phantomjs as a gem.
I have recently installed a system running ubuntu 12.04 LTS as part of a cluster of similar machines running the same software.
I have struck and issue with sys-proctable which when installed by default fails to load with the error:
/var/lib/gems/1.8/gems/sys-proctable-0.9.9-universal-linux/lib/linux/sys/proctable.rb:2:
undefined method `require_relative' for main:Object (NoMethodError)
Require_relative is a ruby 1.9 feature and ubuntu 12.04 installs 1.87.
I tried uninstalling the sys-proctable gem and installing the -0.9.4 version which is what I have on the other systems but I get
rful011#secmonprd07:~$ sudo gem -v 0.9.4 install sys-proctable
[sudo] password for rful011:
1.8.15
and nothing else.
I don't have much flexibility in changing ruby version or OS versions as this machine is part of a much bigger setup.
Any ideas why the attempt to install a specific version prints what appears to be a vesion number and then exits?
Any suggestions for minimalist work arounds.
The command to install a specific version of a gem is
$ gem install the_gem -v 1.2.3
i.e. in your case, with sudo, you should use:
$ sudo gem install sys-proctable -v 0.9.4
The command you have used is:
gem -v 0.9.4 install sys-proctable
i.e. you have the -v 0.9.4 before the install subcommand. In this case the gem executable interprets the -v as the version switch (this can also be specified with --version), which causes it to print out the version of Rubygems. Anything after the -v is ignored.
So there are two types of -v (or --version) flag. The first is written directly after gem (it is the first argument to the command) and causes it to print its version and exit, ignoring anything else on the command line. The second is placed after the gem name when using the install subcommand and specifies the version of the gem you want to be installed. You have just got the wrong one.
See gem help and gem help install for more details.
I have an Ansible playbook that installs Vagrant, and then instructs Vagrant to install a specific plugin. Vagrant has trouble installing a gem it needs, and says:
An error occurred while installing nokogiri (1.6.6.2), and Bundler cannot continue.
Make sure that `sudo gem install nokogiri -v '1.6.6.2'` succeeds before bundling.
stdout: Installing the 'vagrant-aws --version '0.5.0'' plugin. This can take a few minutes...
While I have trouble installing Nokogiri using the command:
$ sudo gem install nokogiri -v '1.6.6.2'
as vagrant does it, I have found that I can install Nokogiri manually, using this command:
$ sudo gem install nokogiri -v 1.6.6.2 -- --use-system-libraries --with-xml2-include=/usr/include/libxml2
Even after I installed the gem manually, vagrant still fails if I manually tell it to install the plugin.
Is there a way to get better control of these dependencies so that vagrant won't fail and my playbook will complete?
It turns out I was missing some key dependencies: build-essential, libxslt1-dev, libxml2-dev, and zlib1g-dev. I found this comment here: https://github.com/mitchellh/vagrant-aws/issues/163#issuecomment-27603855 very helpful.
I believe it's an issue with using sudo to install the ruby gem.
I solved this issue by installing Ruby Version Manager, which installs and manages gems in your home directory.
After installing RVM I could install nokogiri without sudo, but vagrant-aws still failed to install until I re-installed vagrant. If you are building a fresh environment with Ansible then you can probably just install RVM before you install vagrant the first time (or any other ruby stuff). There are other ways to fix your gem permissions as well.
Here are the steps I took:
Install Ruby Version Manager (https://rvm.io/rvm/install)
curl -sSL https://get.rvm.io | bash -s stable --ruby
Install nokogiri without sudo
gem install nokogiri
Re-install vagrant (http://www.vagrantup.com/downloads)
I am trying to install and set up my dev environment for RoR, on a Mac OSX Maverick 10.9.
After run the command:
$ rvm install ruby-2.0.0-p353
the following error out:
Installing required packages: libyaml, openssl.
Error running 'requirements_osx_brew_libs_install libyaml openssl',
showing last 15 lines of /Users/wlinares/.rvm/log/1388963243_ruby-2.0.0-p353/package_install_libyaml_openssl.log
esac;
return $ret
}
}
I downloaded libyaml from http://pyyaml.org/download/libyaml/ and installed following the default instructions.
Then I made the same for openssl so it was installed successfully under: /usr/lib/
Anyone has overcome this error? thanks!
You could try:
$ rvm install 2.0.0-p353 --autolibs=enable
After trying many tricks I could not overcome the issue, then I uninstalled everything and restart the process as a beginner I am. I decided to run the command.
$ gem install rails
then I installed gems:
$ gem install rubygems-update
and finally tested the environment with: rails new blog command.
Until here all seems to be working fine, but I am following the ruby guides in order to start coding my project. I don't have RVM now so I don't know how to handle with upgrades and versions.
That is my only problem, because I was told that Rails change frequently.
I would like to know now how to handle with upgrades including gems.
After going step by step (installed both ruby and rubygems properly) to install watir-webdriver, I am facing following error:
ERROR: Error installing watir-webdriver:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb
<internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- mkmf (LoadError)
from <internal:lib/rubygems/custom_require>:29:in `require'
from extconf.rb:4:in `<main>'
Please help me resolve this and do let me know what made this happened?
Not sure how you are installing ruby on your Ubuntu machine but may I recommend the Ruby Version Manager.
https://rvm.io/
this will allow you to install different versions of ruby on your machine and switch between them as well as gems etc.
here is a quick guide I wrote for installing watir webdriver in Ubuntu via RVM:
Ubuntu requires the use of a Ruby Version Manager. To do this we will need to first install both the Curl package and Git-core.
To do this use the following command:
sudo apt-get install curl git-core
Upon success we will need to download the Ruby Version Manager application. This application allows us to install multiple versions of ruby as well as switch between. It also provides a Gem manger. Recommended to Google to read up on the commands and features within RVM. To install RVM use the following:
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer )
We can also install packages within RVM and we will require the use of openSSL:
rvm pkg install openssl
Then installing Ruby itself:
rvm install 1.9.3-p125 --with-openssl-dir=$rvm_path/usr
Best to test this is all working with:
irb
When all clear we can install the Gem, we need to install it within the RVM with the follow:
rvm do gem install watir-webdriver
If installed correctly we should be able to use watir to drive firefox which is already installed on ubuntu.
I am not Linux/Ubuntu expert but the error message says you do not have build tools installed.