how to update gemfile to only install watir - ruby

This is my gemfile:
source 'https://rubygems.org'
gem 'watir', '~> 5.0', '>= 5.0.0'
gem 'watir-scroll'
gem 'cucumber'
gem 'rspec'
gem 'page-object'
gem 'require_all'
gem 'selenium-webdriver', '~> 2.53', '>= 2.53.1'
gem 'nokogiri', '~> 1.6.8', '>= 1.6.8.1'
gem 'webdriver-user-agent', '~> 7.1'
gem 'headless'
gem 'bundle', '~> 0.0.1'
gem 'appium_lib'
gem 'rake'
gem 'test-unit'
When I execute bundle install with this gemfile, I find watir-webdriver & commonwatir are installed.
I want to only want watir installed.
I don't want watir-webdriver or commonwatir installed.
How should I edit my gemfile?
Thanks for your assistance.

Watir v5.0 is the last version of Watir where it was a meta gem for Watir-Webdriver and Watir-Classic. This is where commonwatir and watir-webdriver gems are dependencies. To remove them and only use Watir(-Webdriver), update the Watir gem to be the current 6.x release.
In other words, change:
gem 'watir', '~> 5.0', '>= 5.0.0'
To:
gem 'watir', '~> 6.0'
You probably should also remove (or at least update) the Selenium-WebDriver requirement. The current version of Watir is not going to work with Selenium-WebDriver v2.x. Given that Watir will already require Selenium, I don't think you need it in your gem file.
gem 'selenium-webdriver', '~> 2.53', '>= 2.53.1'

Both are runtime dependencies of the watir gem, so of course, they would be installed automatically.
https://rubygems.org/gems/watir/versions/5.0.0
Runtime Dependencies (2):
commonwatir ~> 4
watir-webdriver >= 0

Related

Could not find gem 'sass-rails (~> 4.0.3) x64-mingw32' in any of the gem sources listed in your Gemfile

Want to start rake command but get this problem
Could not find gem 'sass-rails (~> 4.0.3) x64-mingw32' in any of the gem sources listed in your Gemfile
Run bundle install to install missing gems.. Here is my gemlist
source 'https://rubygems.org'
gem 'rails', '4.1.4'
gem 'json','~> 1.8.1'
gem 'mongo','~>2.5'
gem "haml-rails", "~> 1.0"
gem "sass-rails",'~> 4.0.3'
gem 'jquery-rails', '~> 3.1.1'
gem 'jquery-ui-rails', '~> 5.0.0'
gem 'cgminer_api_client', '~> 0.2.3'
gem 'cgminer_monitor', '~> 0.2.18'
gem 'rake', '~> 10.3.2'
gem 'therubyracer', '~> 0.12.1'
gem 'thin', '~> 1.6.2'
gem 'uglifier', '~> 2.5.3'
group :development do
gem 'pry'
source 'https://rubygems.org'
gem 'nokogiri'
gem 'rack', '2.0.1'
gem 'rspec'
source 'https://rubygems.org'
gem 'nokogiri'
end
If i tring to get bundle install it's installing corectly, but when i'm tring to strt rake this problem appears again

bundle install error - Your bundle only supports platforms [] but your local platforms are ["ruby", "x86_64-linux"]

Getting this error doing a bundle install; google around seems like a common issue but I can't seem to find the fix (seem suggestion on Gemfile.lock but I moved that file to another directory)
# bundle install
Your bundle only supports platforms [] but your local platforms are ["ruby", "x86_64-linux"], and there's no compatible match between those two lists.
Here's my Gemfile and there is no Gemfile.lock in the directory.
[root#ip-172-30-4-16 rails]# gem -v
2.6.11
[root#ip-172-30-4-16 rails]# ruby -v
ruby 2.2.4p230 (2015-12-16 revision 53155) [x86_64-linux]
[root#ip-172-30-4-16 rails]# bundle -v
Bundler version 1.14.6
[root#ip-172-30-4-16 rails]# cat Gemfile
source 'http://rubygems.org'
gem 'echoe'
gem 'rails', '~> 3.2.11'
gem 'mysql2'
gem 'prawn', '~> 0.5.0.1'
gem 'prawn-core', '~> 0.5.0.1', :require => 'prawn/core'
gem 'prawn-layout', '~> 0.2.0.1', :require => 'prawn/layout'
gem 'prawn-format', '~> 0.2.0.1', :require => 'prawn/format'
gem 'spreadsheet', '~> 0.6.5'
gem 'libxml-ruby', :require => 'libxml_ruby'
gem 'faker'
gem 'json'
gem 'rake'
gem 'jquery-rails'
gem 'therubyracer'
gem 'delayed_job_active_record'
gem 'daemons'
gem 'memcache-client'
gem 'rb-readline'
gem 'rubyzip', '~> 1.0.0'
gem 'zip-zip' # Rubyzip old API compatibility addon
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'uglifier', '>= 1.0.3'
end
#group :development do
# gem 'ruby-debug19'
#end
group :test do
gem 'flexmock', '= 0.9.0'
gem 'machinist', '= 2.0'
gem 'test-unit', '~> 1.2.3'
# Use SimpleCov and Coveralls for test coverage reports
gem 'simplecov'
gem 'coveralls'
end
group :production do
gem 'passenger'
end
group :test, :development do
gem 'rspec-rails', '~> 2.0'
end
I had the same issue, I had to remove the .bundle directory and then bundle install worked.
I was able to work around issue /w bundle install --no-deployment option
If you get this error when using GitHub Actions, you can fix it by adding the Ruby platform to your Gemfile.lock:
$ bundle lock --add-platform ruby
Then commit, and push your change.

Ruby gem dependency issue

Can anyone help me solve this Ruby gem dependency issue??
I'm trying to install this library described here
http://datagraph.rubyforge.org/sinatra-linkeddata/#Dependencies
Bundler gives me the following error. (Does it seem like there is an incompatibility between the 'linkeddata' gem and the 'sinatra-linkeddata' gem I'm trying to install.
Bundler could not find compatible versions for gem "linkeddata":
In Gemfile:
sinatra-linkeddata (>= 0) ruby depends on
linkeddata (~> 0.2.0) ruby
linkeddata (1.1.1)
My gem file looks like this: how should I modify it.
source 'https://rubygems.org'
gem "nokogiri"
gem 'sinatra'
gem 'rdf'
gem 'sparql'
gem 'linkeddata'
gem 'sass'
gem 'tilt', '>= 1.3.4', '~> 1.3'
gem 'thin'
gem 'sinatra-linkeddata'
Try running bundle update. If that doesn't work you can modify gem 'linkeddata' to gem 'linkeddata', '~> 0.2.0' in order to match the dependency of sinatra-linkeddata and then run bundle update linkeddata

Gemfile when developing between two platforms

I am carrying out some development of a Ruby on Rails app between a Windows machine and linux machine. Not ideal but Ruby on Windows has improved a lot. Anyway i read that you can implement an IF statement so for example I have implemented this
source 'https://rubygems.org'
if RUBY_PLATFORM =~ /win32/
gem 'rails', '3.2.3'
gem 'sqlite3'
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'twitter-bootstrap-rails', :git => 'git://github.com/seyhunak/twitter-bootstrap-rails.git'
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
gem 'nokogiri'
gem 'httparty'
gem 'devise'
else
gem 'rails', '3.2.3'
gem 'sqlite3', '1.3.6'
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'twitter-bootstrap-rails', :git => 'git://github.com/seyhunak/twitter-bootstrap-rails.git'
gem 'less-rails'
gem 'uglifier', '>= 1.0.3'
gem 'execjs'
gem 'therubyracer', '0.10.2'
end
gem 'jquery-rails'
gem 'nokogiri'
gem 'httparty'
gem 'devise'
end
So this morning I merged my linux branch into the master branch (windows) and now i get the message
Could not find the less-rails in any of the sources
So it seems as if the IF statement has not worked or there is an issue with my bootstrap.css.less file in assets as I use this in my linux branch
How can i get this to work, so either have less working on both platforms or get windows to ignore the less gem
has anyone got around this before
UPDATE
Ok so i have found that if I specify
:platform => :ruby
after the less-rails gem it ignores it (though I had to add to execjs and rubyracer aswell) due to js runtime conflicts.. So question still remains as to what is wrong with my IF/ELSE statement
Thanks
Have you rebuilt the bundle lock file?
Try this on your Windows machine:
bundle install
bundle update
To learn about bundle, Gemfile, Gemfile.lock, and why you need to rebuild the lock when you switch platforms: http://gembundler.com/rationale.html

can't install gem dm-adapter-simpledb

any idea what should I do? this is error message from bundler
$ bundle install
Fetching gem metadata from http://rubygems.org/........
Fetching gem metadata from http://rubygems.org/..
Bundler could not find compatible versions for gem "dm-core":
In Gemfile:
dm-adapter-simpledb (>= 0) ruby depends on
dm-core (~> 0.10.0) ruby
dm-core (1.2.0)
here is my Gemfile
source 'http://rubygems.org'
gem 'sinatra'
gem 'json'
gem 'prawn'
gem 'prawn-graph'
gem 'prawn-layout'
gem 'prawn-fast-png'
gem 'prawn-qrcode'
gem 'data_mapper'
gem 'dm-core'
gem 'dm-mysql-adapter'
gem 'dm-postgres-adapter'
gem 'dm-migrations'
gem 'dm-adapter-simpledb'
gem 'aws-sdk', '~> 1.3.4'
gem 'dm-paperclip'
gem 'savon'
gem 'rmagick'
gem 'SystemTimer', :require => "system_timer", :platforms => :ruby_18
gem 'rack-timeout'
gem 'rufus-scheduler'
gem 'mail'
Try to remove dm-core gem from the Gemfile. You don't need it anyway - dm-adapter-simpledb requires it.
If you absolutely must include dm-core gem in the Gemfile, set it to the version required by dm-adapter-simpledb in Gemfile.lock.
dm-adapter-simpledb in your gemfile depends on dm-core version 0.10.0, the one you have is 1.2.0. either remove it as Lukas suggested or update your gemfile: `dm-core', '~> 0.10.0'

Resources