Using the :class locator to locate multiple classes with a String value is deprecated; use an Array instead - ruby

I am working on Automation using Ruby and Cucumber Watir Webdriver framework.
I updated the Ruby Gems and did a bundle install.
Then I started getting a warning message as "Using the :class locator to locate multiple classes with a String value is deprecated; use an Array instead"
When this warning message was fixed, on one of my colleague's system by replacing the class values in the square brackets to make it as an array.
When I took a pull from Git of the latest code which had a fix, I started getting an error message as "TypeError: expected one of [String, Regexp], got ["x-img xcp_image-cls xcpid_image x-box-item x-img-default"]:Array"
I am using the Ruby with version "ruby 2.2.6p396".
I tried with bundle install and gem updates, but nothing worked.
Please guide with what can be done to resolve this issue.
My GemFile.lock content:
GEM
remote: https://rubygems.org/
specs:
archive-zip (0.7.0)
io-like (~> 0.3.0)
builder (3.2.2)
childprocess (0.5.9)
ffi (~> 1.0, >= 1.0.11)
chromedriver-helper (1.1.0)
archive-zip (~> 0.7.0)
nokogiri (~> 1.6)
cucumber (2.4.0)
builder (>= 2.1.2)
cucumber-core (~> 1.5.0)
cucumber-wire (~> 0.0.1)
diff-lcs (>= 1.1.3)
gherkin (~> 4.0)
multi_json (>= 1.7.5, < 2.0)
multi_test (>= 0.1.2)
cucumber-core (1.5.0)
gherkin (~> 4.0)
cucumber-wire (0.0.1)
data_magic (1.0)
faker (>= 1.1.2)
yml_reader (>= 0.6)
diff-lcs (1.2.5)
faker (1.7.1)
i18n (~> 0.5)
ffi (1.9.14-x64-mingw32)
gherkin (4.0.0)
i18n (0.7.0)
io-like (0.3.0)
mini_portile2 (2.1.0)
multi_json (1.12.1)
multi_test (0.1.2)
net-http-persistent (2.9.4)
nokogiri (1.7.1-x64-mingw32)
mini_portile2 (~> 2.1.0)
page-object (2.0.0)
net-http-persistent (~> 2.9.4)
page_navigation (>= 0.9)
selenium-webdriver (~> 3.0)
watir (~> 6.0)
page_navigation (0.10)
data_magic (>= 0.22)
rake (12.0.0)
rspec (3.5.0)
rspec-core (~> 3.5.0)
rspec-expectations (~> 3.5.0)
rspec-mocks (~> 3.5.0)
rspec-core (3.5.4)
rspec-support (~> 3.5.0)
rspec-expectations (3.5.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.5.0)
rspec-mocks (3.5.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.5.0)
rspec-support (3.5.0)
rubyzip (1.2.0)
selenium-webdriver (3.3)
childprocess (~> 0.5)
rubyzip (~> 1.0)
websocket (~> 1.0)
watir (6.0.3)
selenium-webdriver (~> 3.3)
websocket (1.2.3)
yml_reader (0.7)
PLATFORMS
x64-mingw32
DEPENDENCIES
chromedriver-helper
cucumber
data_magic
page-object
rake
rspec
BUNDLED WITH
1.13.7

Locating by multiple classes was added in version 6.5. Your gem file shows you are still using version 6.0.3. Using a version earlier than 6.5 will result in the TypeError that you are seeing.
You need to upgrade your version of Watir to 6.5 or later.

Related

Selenium::WebDriver::Error::WebDriverError: no sessionId in returned payload - Moving from ruby 2.5.3. to 3.1.2

Upgraded ruby from 2.5.3 to 3.1.2 and associated gems. Cucumber tests were running fine against v 2.5.3 on chrome but now getting the below error and stack trace. Also attached my gemfile.lock
SELENIUM BROWSER: chrome
CHROME PATH: /opt/google/chrome
CHROME DRIVER: /home/####/git/se/acceptancetests/chromedriver
Selenium::WebDriver::Error::WebDriverError: no sessionId in returned payload
/home/####/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/selenium-webdriver-4.8.0/lib/selenium/webdriver/remote/bridge.rb:57:in create_session' /home/####/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/selenium-webdriver-4.8.0/lib/selenium/webdriver/common/driver.rb:313:in block in create_bridge'
internal:kernel:90:in tap' /home/####/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/selenium-webdriver-4.8.0/lib/selenium/webdriver/common/driver.rb:312:in create_bridge'
/home/####/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/selenium-webdriver-4.8.0/lib/selenium/webdriver/common/driver.rb:74:in initialize' /home/####/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/selenium-webdriver-4.8.0/lib/selenium/webdriver/chrome/driver.rb:36:in initialize'
/home/####/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/selenium-webdriver-4.8.0/lib/selenium/webdriver/common/driver.rb:47:in new' /home/####/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/selenium-webdriver-4.8.0/lib/selenium/webdriver/common/driver.rb:47:in for'
/home/####/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/selenium-webdriver-4.8.0/lib/selenium/webdriver.rb:88:in for' /home/####/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/capybara-3.38.0/lib/capybara/selenium/driver.rb:83:in browser'
/home/####/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/capybara-3.38.0/lib/capybara/selenium/driver.rb:137:in execute_script' /home/####/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/capybara-3.38.0/lib/capybara/session.rb:605:in execute_script'
/home/####/git/see/acceptancetests/features/step_definitions/store_steps.rb:2827:in wait_for_page_load' /home/####/git/se/acceptancetests/features/support/hooks.rb:18:in AfterStep'
Gemfile.lock:
GEM
remote: ###
specs:
addressable (2.8.1)
public_suffix (>= 2.0.2, < 6.0)
axe-matchers (2.6.1)
dumb_delegator (~> 0.8)
virtus (~> 1.0)
axiom-types (0.1.1)
descendants_tracker (~> 0.0.4)
ice_nine (~> 0.11.0)
thread_safe (~> 0.3, >= 0.3.1)
builder (3.2.4)
capybara (3.14.0)
addressable
matrix
mini_mime (>= 0.1.3)
nokogiri (~> 1.8)
rack (>= 1.6.0)
rack-test (>= 0.6.3)
regexp_parser (>= 1.5, < 3.0)
xpath (~> 3.2)
coercible (1.0.0)
descendants_tracker (~> 0.0.1)
concurrent-ruby (1.2.0)
cucumber (5.3.0)
builder (~> 3.2, >= 3.2.4)
cucumber-ci-environment (~> 9.0, >= 9.0.4)
cucumber-core (~> 11.0, >= 11.0.0)
cucumber-cucumber-expressions (~> 15.1, >= 15.1.1)
cucumber-gherkin (~> 23.0, >= 23.0.1)
cucumber-html-formatter (~> 19.1, >= 19.1.0)
cucumber-messages (~> 18.0, >= 18.0.0)
diff-lcs (~> 1.5, >= 1.5.0)
mime-types (~> 3.4, >= 3.4.1)
multi_test (~> 1.1, >= 1.1.0)
sys-uname (~> 1.2, >= 1.2.2)
cucumber-ci-environment (9.1.0)
cucumber-core (11.0.0)
cucumber-gherkin (~> 23.0, >= 23.0.1)
cucumber-messages (~> 18.0, >= 18.0.0)
cucumber-tag-expressions (~> 4.1, >= 4.1.0)
cucumber-cucumber-expressions (15.2.0)
cucumber-gherkin (23.0.1)
cucumber-messages (~> 18.0, >= 18.0.0)
cucumber-html-formatter (19.2.0)
cucumber-messages (~> 18.0, >= 18.0.0)
cucumber-messages (18.0.0)
cucumber-tag-expressions (4.1.0)
descendants_tracker (0.0.4)
thread_safe (~> 0.3, >= 0.3.1)
diff-lcs (1.5.0)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
dumb_delegator (0.8.1)
equalizer (0.0.11)
excon (0.98.0)
ffi (1.15.5)
headless (2.3.1)
http-accept (1.7.0)
http-cookie (1.0.5)
domain_name (~> 0.5)
i18n (1.12.0)
concurrent-ruby (~> 1.0)
ice_nine (0.11.2)
jwt (2.2.3)
matrix (0.4.2)
mime-types (3.4.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2022.0105)
mini_mime (1.1.2)
mini_portile2 (2.6.1)
multi_test (1.1.0)
mysql2 (0.5.5)
netrc (0.11.0)
nokogiri (1.12.5)
mini_portile2 (~> 2.6.1)
racc (~> 1.4)
parallel (1.22.1)
parallel_tests (3.13.0)
parallel
public_suffix (5.0.1)
racc (1.6.2)
rack (3.0.4.1)
rack-test (2.0.2)
rack (>= 1.3)
regexp_parser (2.6.2)
rest-client (2.1.0)
http-accept (>= 1.7.0, < 2.0)
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
rexml (3.2.5)
rspec (3.12.0)
rspec-core (~> 3.12.0)
rspec-expectations (~> 3.12.0)
rspec-mocks (~> 3.12.0)
rspec-core (3.12.0)
rspec-support (~> 3.12.0)
rspec-expectations (3.12.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-mocks (3.12.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-support (3.12.0)
ruby-hmac (0.4.0)
ruby-oci8 (2.2.12)
rubyzip (2.3.2)
selenium-webdriver (4.8.0)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
sys-uname (1.2.2)
ffi (~> 1.1)
thread_safe (0.3.6)
unf (0.1.4)
unf_ext
unf_ext (0.0.8.2)
virtus (1.0.5)
axiom-types (~> 0.1)
coercible (~> 1.0)
descendants_tracker (~> 0.0, >= 0.0.3)
equalizer (~> 0.0, >= 0.0.9)
websocket (1.2.9)
xpath (3.2.0)
nokogiri (~> 1.8)
PLATFORMS
ruby
DEPENDENCIES
axe-matchers
capybara
cucumber
excon
headless
i18n
jwt (~> 2.2.2)
mysql2
nokogiri (= 1.12.5)
The error here is indicative of you failing to generate capabilities correctly. So it's likely whatever updates you have done to selenium are now causing you to generate an invalid payload.
Around selenium 4alpha6 some large changes went in (So for v3 you could use desired_capabilities but now you simply use capabilities)
If you're using capybara you can use the gem here to just generate a simple driver in 1 click https://github.com/site-prism/automation_helpers/blob/main/lib/automation_helpers/drivers/local.rb#L7
EDIT: Your gems are a bit mismatched also. You're using an up to date selenium-webdriver but a really old version of capybara. See if you can keep those similar in age

How to resolve a mixlib-shellout gem version conflict?

I am trying use to Kitchen/Chef to deploy. I am actually not sure if I've touched Kitchen yet.
My understanding is gem list lists all the gems in the repository, and a project fetches any gems it wants from this repository.
After I ran gem install bundler and gem install berkshelf I have a mixlib-shellout (2.2.6) shown by gem list | grep shellout.
Then I ran bundle install and based on my Gemfile, "mixlib-shellout (1.6.1)" is installed. Then I have "mixlib-shellout (2.2.6, 1.6.1)" shown by gem list | grep shellout.
From Gemfile.lock, I believe 1.6.1 is the version wanted. Then I ran berks install, an exception was thrown, which was:
Unable to activate chef-11.18.12, because mixlib-shellout-2.2.6 conflicts with mixlib-shellout (~> 1.4) - 11.18.12 - (Gem::LoadError)
I don't understand why it tries to fetch 2.2.6 instead of 1.6.1.
My Gemfile
source 'https://rubygems.org'
group :development do
gem 'berkshelf', '~> 4.0'
gem 'berkshelf-api-client', '~> 2.0'
gem 'thor'
gem 'chef', '~> 11.16'
gem 'test-kitchen', '~> 1.2'
gem 'kitchen-vagrant', '>= 0.16'
gem 'serverspec'
gem 'infrataster'
gem 'busser'
gem 'busser-serverspec'
gem 'chefspec', '~>4'
gem 'rubocop'
gem 'foodcritic'
end
gem 'chef-vault', '~> 2.2'
Gemfile.lock
GEM
remote: https://rubygems.org/
specs:
addressable (2.3.8)
ast (2.2.0)
berkshelf (4.1.0)
addressable (~> 2.3.4)
berkshelf-api-client (~> 2.0)
buff-config (~> 1.0)
buff-extensions (~> 1.0)
buff-shell_out (~> 0.1)
celluloid (= 0.16.0)
celluloid-io (~> 0.16.1)
cleanroom (~> 1.0)
faraday (~> 0.9.0)
httpclient (~> 2.6.0)
minitar (~> 0.5.4)
octokit (~> 4.0)
retryable (~> 2.0)
ridley (~> 4.3)
solve (~> 2.0)
thor (~> 0.19)
berkshelf-api-client (2.0.0)
faraday (~> 0.9.1)
httpclient (~> 2.6.0)
buff-config (1.0.1)
buff-extensions (~> 1.0)
varia_model (~> 0.4)
buff-extensions (1.0.0)
buff-ignore (1.1.1)
buff-ruby_engine (0.1.0)
buff-shell_out (0.2.0)
buff-ruby_engine (~> 0.1.0)
busser (0.7.1)
thor (<= 0.19.0)
busser-serverspec (0.5.9)
busser
capybara (2.6.2)
addressable
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (~> 2.0)
celluloid (0.16.0)
timers (~> 4.0.0)
celluloid-io (0.16.2)
celluloid (>= 0.16.0)
nio4r (>= 1.1.0)
chef (11.18.12)
chef-zero (~> 2.2, >= 2.2.1)
diff-lcs (~> 1.2, >= 1.2.4)
erubis (~> 2.7)
ffi-yajl (~> 1.2)
highline (~> 1.6, >= 1.6.9)
mime-types (~> 1.16)
mixlib-authentication (~> 1.3)
mixlib-cli (~> 1.4)
mixlib-config (~> 2.0)
mixlib-log (~> 1.3)
mixlib-shellout (~> 1.4)
net-ssh (~> 2.6)
net-ssh-multi (~> 1.1)
ohai (~> 7.4)
plist (~> 3.1.0)
pry (~> 0.9)
rest-client (>= 1.0.4, <= 1.6.7)
chef-vault (2.7.1)
chef-zero (2.2.1)
ffi-yajl (~> 1.1)
hashie (~> 2.0)
mixlib-log (~> 1.3)
rack
chefspec (4.5.0)
chef (>= 11.14)
fauxhai (~> 3.0, >= 3.0.1)
rspec (~> 3.0)
cleanroom (1.0.0)
cliver (0.3.2)
coderay (1.1.0)
diff-lcs (1.2.5)
erubis (2.7.0)
faraday (0.9.2)
multipart-post (>= 1.2, < 3)
faraday_middleware (0.10.0)
faraday (>= 0.7.4, < 0.10)
fauxhai (3.1.0)
net-ssh
ffi (1.9.10)
ffi-yajl (1.4.0)
ffi (~> 1.5)
libyajl2 (~> 1.2)
foodcritic (6.0.0)
erubis
gherkin (~> 2.11)
nokogiri (>= 1.5, < 2.0)
rake
rufus-lru (~> 1.0)
treetop (~> 1.4)
yajl-ruby (~> 1.1)
gherkin (2.12.2)
multi_json (~> 1.3)
hashie (2.1.2)
highline (1.7.8)
hitimes (1.2.3)
httpclient (2.6.0.1)
infrataster (0.3.2)
capybara
faraday
faraday_middleware (>= 0.10.0)
net-ssh
net-ssh-gateway
poltergeist
rspec (>= 2.0, < 4.0)
thor
ipaddress (0.8.2)
json (1.8.3)
kitchen-vagrant (0.19.0)
test-kitchen (~> 1.4)
libyajl2 (1.2.0)
method_source (0.8.2)
mime-types (1.25.1)
mini_portile2 (2.0.0)
minitar (0.5.4)
mixlib-authentication (1.4.0)
mixlib-log
rspec-core (~> 3.2)
rspec-expectations (~> 3.2)
rspec-mocks (~> 3.2)
mixlib-cli (1.5.0)
mixlib-config (2.2.1)
mixlib-log (1.6.0)
mixlib-shellout (1.6.1)
molinillo (0.2.3)
multi_json (1.11.2)
multipart-post (2.0.0)
net-scp (1.2.1)
net-ssh (>= 2.6.5)
net-ssh (2.9.4)
net-ssh-gateway (1.2.0)
net-ssh (>= 2.6.5)
net-ssh-multi (1.2.1)
net-ssh (>= 2.6.5)
net-ssh-gateway (>= 1.2.0)
net-telnet (0.1.1)
nio4r (1.2.1)
nokogiri (1.6.7.2)
mini_portile2 (~> 2.0.0.rc2)
octokit (4.2.0)
sawyer (~> 0.6.0, >= 0.5.3)
ohai (7.4.1)
ffi (~> 1.9)
ffi-yajl (~> 1.1)
ipaddress
mime-types (~> 1.16)
mixlib-cli
mixlib-config (~> 2.0)
mixlib-log
mixlib-shellout (~> 1.2)
systemu (~> 2.6.4)
wmi-lite (~> 1.0)
parser (2.3.0.3)
ast (~> 2.2)
plist (3.1.0)
poltergeist (1.9.0)
capybara (~> 2.1)
cliver (~> 0.3.1)
multi_json (~> 1.0)
websocket-driver (>= 0.2.0)
polyglot (0.3.5)
powerpack (0.1.1)
pry (0.10.3)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
rack (1.6.4)
rack-test (0.6.3)
rack (>= 1.0)
rainbow (2.1.0)
rake (10.5.0)
rest-client (1.6.7)
mime-types (>= 1.16)
retryable (2.0.3)
ridley (4.4.1)
addressable
buff-config (~> 1.0)
buff-extensions (~> 1.0)
buff-ignore (~> 1.1)
buff-shell_out (~> 0.1)
celluloid (~> 0.16.0)
celluloid-io (~> 0.16.1)
erubis
faraday (~> 0.9.0)
hashie (>= 2.0.2, < 4.0.0)
httpclient (~> 2.6)
json (>= 1.7.7)
mixlib-authentication (>= 1.3.0)
retryable (~> 2.0)
semverse (~> 1.1)
varia_model (~> 0.4.0)
rspec (3.4.0)
rspec-core (~> 3.4.0)
rspec-expectations (~> 3.4.0)
rspec-mocks (~> 3.4.0)
rspec-core (3.4.2)
rspec-support (~> 3.4.0)
rspec-expectations (3.4.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.4.0)
rspec-its (1.2.0)
rspec-core (>= 3.0.0)
rspec-expectations (>= 3.0.0)
rspec-mocks (3.4.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.4.0)
rspec-support (3.4.1)
rubocop (0.37.0)
parser (>= 2.3.0.2, < 3.0)
powerpack (~> 0.1)
rainbow (>= 1.99.1, < 3.0)
ruby-progressbar (~> 1.7)
unicode-display_width (~> 0.3)
ruby-progressbar (1.7.5)
rufus-lru (1.0.5)
safe_yaml (1.0.4)
sawyer (0.6.0)
addressable (~> 2.3.5)
faraday (~> 0.8, < 0.10)
semverse (1.2.1)
serverspec (2.29.1)
multi_json
rspec (~> 3.0)
rspec-its
specinfra (~> 2.48)
sfl (2.2)
slop (3.6.0)
solve (2.0.2)
molinillo (~> 0.2.3)
semverse (~> 1.1)
specinfra (2.50.4)
net-scp
net-ssh (>= 2.7, < 3.1)
net-telnet
sfl
systemu (2.6.5)
test-kitchen (1.4.2)
mixlib-shellout (>= 1.2, < 3.0)
net-scp (~> 1.1)
net-ssh (~> 2.7, < 2.10)
safe_yaml (~> 1.0)
thor (~> 0.18)
thor (0.19.0)
timers (4.0.4)
hitimes
treetop (1.6.3)
polyglot (~> 0.3)
unicode-display_width (0.3.1)
varia_model (0.4.1)
buff-extensions (~> 1.0)
hashie (>= 2.0.2, < 4.0.0)
websocket-driver (0.6.3)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.2)
wmi-lite (1.0.0)
xpath (2.0.0)
nokogiri (~> 1.3)
yajl-ruby (1.2.1)
PLATFORMS
ruby
DEPENDENCIES
berkshelf (~> 4.0)
berkshelf-api-client (~> 2.0)
busser
busser-serverspec
chef (~> 11.16)
chef-vault (~> 2.2)
chefspec (~> 4)
foodcritic
infrataster
kitchen-vagrant (>= 0.16)
rubocop
serverspec
test-kitchen (~> 1.2)
thor
BUNDLED WITH
1.11.2
You do not want to be bundling chef-11.18.12 with test-kitchen and berkshelf. You don't need to bundle chef with those tools, and you definitely will run into issues trying to bundle chef-11 with them.
The problem with creating a Gemfile with all of your cli tools in them is that those tools never activate the entire set of gems all at once. So test-kitchen does not depend on chef, and berkshelf only recently started pulling in chef-config as a library. When you try to create a bundle you are stating that every gem must be capable of being loaded into the same ruby process with every other gem. Even for the latest set of cli tools this is something which will frequently break. If you add in chef-11.18.12 then you are picking a gem with a frozen set of gem requirements from April of last year (about 9 months ago), and its highly likely that the latest test-kitchen and berkshelf versions will pull in versions of mixlib-shellout that are incompatible with that version of chef. It gets worse because we made breaking changes to mixlib-shellout and chef-11 is forever pinned on an old branch of mixlib-shellout that is not getting updates, while test-kitchen and berkshelf have moved on.
This is why ChefDK exists which is to give a consistent set of command line tools, in something that looks superficially like a bundle, but which is not a bundle. If test-kitchen or berkshelf don't load chef into memory simultaneously, then it is fine to include different versions of those gems which may 'conflict' in their use of mixlib-shellout but will load into different ruby process just fine. Since they never all try to load into the same ruby process the 'conflict' over mixlib-shellout never becomes a real one.
Also, we do try to take a bit of care that they all load together correctly and we don't wind up with multiple versions of mixlib-shellout in the ChefDK, but sometimes this is difficult to avoid.
What you are probably trying to do is bundle everything together because you want to have the latest toolchain, but want to use chef-11 because your production is chef-11. But the issue there is that when you are using berkshelf or test-kitchen there is no requirement to use chef-11 in that ruby process that you are launching. When TK starts, it should start up a virt, and will then install chef on that virt and launch it -- you should be making sure that virt has chef-11 so you can test your cookbooks, not that your TK process is bundled with chef-11. Whatever chef gem TK is bundled with is completely irrelevant to how it operates.
If you're trying to test chef-11 with test-kitchen the right way to do that is by setting the require_chef_omnibus config parameter to "11.18.12" in your kitchen.yml file. That will cause chef-11 to get installed on the virt you are trying to provision.
+1 on the recommendation to simply start by installing ChefDK and not trying to bundle your own toolset.
It is even recommended to use chef-12 knife and ChefDK on your workstation to manage chef-11 virts/hosts. There is one gotcha where chefspec really does run on your workstation and testing chefspec against chef-12 when your production is chef-11 could allow certain kinds of failures to go undetected. You could bundle chefspec against chef-11 and do testing that way -- however, its most likely better to stick with full integration testing with test-kitchen to find those problems, and just use chefspec as quick flame tests (or not use it at all -- unit testing and mocking out your resource collection are conceptually fairly advanced topics). Until you actually hit and issue with chefspec, its best not to worry about the chef version on your workstation and just use the latest chef version for knife.

Could not find i18n-0.6.9 in any of the sources

Actually i'm getting that error inside the travis build.
My Gemfile is:
source 'http://rubygems.org'
# Gemfile for youtube_dlhelper
# Add dependencies required to use your gem here.
group :default do
gem 'highline'
gem 'dir'
gem 'fileutils2'
gem 'parseconfig'
gem 'viddl-rb'
gem 'streamio-ffmpeg'
gem 'rainbow'
gem 'gli'
end
# Add dependencies to develop your gem here.
# Include everything needed to run rake, tests, features, etc.
group :development do
gem 'rdoc', '~> 4.1.0'
gem 'bundler', '~> 1.0'
gem 'jeweler', '~> 2.0.0'
gem 'yard'
gem 'gem-release'
end
group :test do
gem 'shoulda', '>= 0'
gem 'rspec'
gem 'coveralls', require: false
gem 'simplecov'
end
The Gemfile.lock:
GEM
remote: http://rubygems.org/
specs:
activesupport (4.0.2)
i18n (~> 0.6, >= 0.6.4)
minitest (~> 4.2)
multi_json (~> 1.3)
thread_safe (~> 0.1)
tzinfo (~> 0.3.37)
addressable (2.3.5)
atomic (1.1.14)
builder (3.2.2)
coveralls (0.7.0)
multi_json (~> 1.3)
rest-client
simplecov (>= 0.7)
term-ansicolor
thor
descendants_tracker (0.0.3)
diff-lcs (1.2.5)
dir (0.1.2)
docile (1.1.1)
domain_name (0.5.15)
unf (>= 0.0.5, < 1.0.0)
faraday (0.8.8)
multipart-post (~> 1.2.0)
fileutils2 (0.2.0)
gem-release (0.7.1)
git (1.2.6)
github_api (0.11.1)
addressable (~> 2.3)
descendants_tracker (~> 0.0.1)
faraday (~> 0.8, < 0.10)
hashie (>= 1.2)
multi_json (>= 1.7.5, < 2.0)
nokogiri (~> 1.6.0)
oauth2
gli (2.8.1)
hashie (2.0.5)
highline (1.6.20)
http-cookie (1.0.2)
domain_name (~> 0.5)
httpauth (0.2.0)
i18n (0.6.9)
jeweler (2.0.0)
builder
bundler (>= 1.0)
git (>= 1.2.5)
github_api
highline (>= 1.6.15)
nokogiri (>= 1.5.10)
rake
rdoc
json (1.8.1)
jwt (0.1.8)
multi_json (>= 1.5)
mechanize (2.7.3)
domain_name (~> 0.5, >= 0.5.1)
http-cookie (~> 1.0)
mime-types (~> 2.0)
net-http-digest_auth (~> 1.1, >= 1.1.1)
net-http-persistent (~> 2.5, >= 2.5.2)
nokogiri (~> 1.4)
ntlm-http (~> 0.1, >= 0.1.1)
webrobots (>= 0.0.9, < 0.2)
mime-types (2.0)
mini_portile (0.5.2)
minitest (4.7.5)
multi_json (1.8.2)
multi_xml (0.5.5)
multipart-post (1.2.0)
net-http-digest_auth (1.4)
net-http-persistent (2.9)
nokogiri (1.6.1)
mini_portile (~> 0.5.0)
ntlm-http (0.1.1)
oauth2 (0.9.2)
faraday (~> 0.8)
httpauth (~> 0.2)
jwt (~> 0.1.4)
multi_json (~> 1.0)
multi_xml (~> 0.5)
rack (~> 1.2)
parseconfig (1.0.4)
progressbar (0.21.0)
rack (1.5.2)
rainbow (1.99.1)
rake (10.1.1)
rdoc (4.1.0)
json (~> 1.4)
rest-client (1.6.7)
mime-types (>= 1.16)
rspec (2.14.1)
rspec-core (~> 2.14.0)
rspec-expectations (~> 2.14.0)
rspec-mocks (~> 2.14.0)
rspec-core (2.14.7)
rspec-expectations (2.14.4)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.14.4)
shoulda (3.5.0)
shoulda-context (~> 1.0, >= 1.0.1)
shoulda-matchers (>= 1.4.1, < 3.0)
shoulda-context (1.1.6)
shoulda-matchers (2.4.0)
activesupport (>= 3.0.0)
simplecov (0.8.2)
docile (~> 1.1.0)
multi_json
simplecov-html (~> 0.8.0)
simplecov-html (0.8.0)
streamio-ffmpeg (1.0.0)
term-ansicolor (1.2.2)
tins (~> 0.8)
thor (0.18.1)
thread_safe (0.1.3)
atomic
tins (0.13.1)
tzinfo (0.3.38)
unf (0.1.3)
unf_ext
unf_ext (0.0.6)
viddl-rb (0.79)
mechanize
nokogiri
progressbar
webrobots (0.1.1)
yard (0.8.7.3)
PLATFORMS
ruby
DEPENDENCIES
bundler (~> 1.0)
coveralls
dir
fileutils2
gem-release
gli
highline
jeweler (~> 2.0.0)
parseconfig
rainbow
rdoc (~> 4.1.0)
rspec
shoulda
simplecov
streamio-ffmpeg
viddl-rb
yard
I searched inside Stackoverflow and found mostly the answer to make a bundle install or remove the lock and bundle install again.
Also i tried out to use bundle install -deployment but that one uses all dependencies, and my *.gem is ~60M big (by using rake release).
Is there a better solution?
I've found the solution. The problem was, that i have overwritten the install section of .travis.yml. So bundle install aren't executed and it doesn't found it.
So the fix:
from
install:
- sudo apt-get install ubuntu-restricted-extras ffmpeg
to
before_install:
- sudo apt-get install ubuntu-restricted-extras ffmpeg

Error while deploying Ruby Application into Stackato

I am deploying Rack based ruby Application in stackato. Because of local network i have downloaded all my gems locally when i try to push after some stagging i am getting the following error.
Fetching missing gems from RubyGems
staging: http://production.s3.rubygems.org/gems/bundler-1.2.1.gem:
staging: 2013-12-13 01:36:21 ERROR 504: Host production.s3.rubygems.org lookup
failed: Host not found.
staging: wget failed to fetch http://production.s3.rubygems.org/gems/bundler-1.2.1.gem
staging: /home/stackato/stackato/vcap/staging/lib/vcap/staging/plug/gemfile_task.rb:134:in `block in install_gems': Failed fetching missing gems from RubyGems (RuntimeError)
Failed to stage application:
staging plugin exited with non-zero exit code
i thought it is a Gateway error but when i go through my gem list i found
bundler (1.2.1)
if i run bundle install --local --deployment and bundle package it is successfully running the bundle. i have an rbenv here rather than rvm i tried to install bundler at global.
I don't know why it is hitting that host.
Killing my time since three days.
Help me please Thanks in advance
Update
Gemfile:
source 'http://rubygems.org'
source 'http://gemserver.portal.sb.net'
gem 'sinatra'
gem 'grape','0.6.0'
gem 'rack-fiber_pool'
gem 'haml'
gem 'hashie'
gem 'idp-utilities', require: %w(idp/test_utils/string idp/middleware/idp_url idp/logging)
gem 'idp-clients', '~> 0.1.8', require: %W(idp/middleware/clients idp/content/client idp/user/client idp/session/client idp/authentication/client idp/exceptions idp/user/exceptions)
gem "newrelic_rpm", "~> 3.6.8.168"
group :test do
gem 'page_object'
gem 'cucumber', '1.2.5'
gem 'rspec'
gem 'watir-webdriver'
gem 'childprocess'
gem 'waitforit'
gem 'httparty'
gem 'rack-test'
gem 'mirage', '3.0.0.alpha.15', require: 'mirage/client'
gem 'simplecov'
gem 'idp-user_service_mocks'
gem 'idp-content_service_mock'
end
group :development do
gem 'rake'
gem 'shotgun'
gem 'thin'
gem 'sinatra-contrib'
gem 'sinatra-reloader'
end
and my Gemfile.lock is
GEM
remote: http://rubygems.org/
remote: http://gemserver.portal.sb.net/
specs:
activesupport (4.0.1)
i18n (~> 0.6, >= 0.6.4)
minitest (~> 4.2)
multi_json (~> 1.3)
thread_safe (~> 0.1)
tzinfo (~> 0.3.37)
addressable (2.3.5)
akami (1.2.0)
gyoku (>= 0.4.0)
nokogiri (>= 1.4.0)
atomic (1.1.14)
axiom-types (0.0.5)
descendants_tracker (~> 0.0.1)
ice_nine (~> 0.9)
backports (3.3.5)
builder (3.2.2)
childprocess (0.3.9)
ffi (~> 1.0, >= 1.0.11)
coercible (0.2.0)
backports (~> 3.0, >= 3.1.0)
descendants_tracker (~> 0.0.1)
cookiejar (0.3.0)
cucumber (1.2.5)
builder (>= 2.1.2)
diff-lcs (>= 1.1.3)
gherkin (~> 2.11.7)
multi_json (~> 1.3)
daemons (1.1.9)
descendants_tracker (0.0.3)
diff-lcs (1.2.4)
em-http-request (1.1.1)
addressable (>= 2.3.4)
cookiejar
em-socksify (>= 0.3)
eventmachine (>= 1.0.3)
http_parser.rb (>= 0.6.0.beta.2)
em-socksify (0.3.0)
eventmachine (>= 1.0.0.beta.4)
em-synchrony (1.0.3)
eventmachine (>= 1.0.0.beta.1)
equalizer (0.0.7)
eventmachine (1.0.3)
faraday (0.8.8)
multipart-post (~> 1.2.0)
faraday_middleware (0.9.0)
faraday (>= 0.7.4, < 0.9)
ffi (1.9.3)
gherkin (2.11.8)
multi_json (~> 1.3)
grape (0.6.0)
activesupport
builder
hashie (>= 1.2.0)
multi_json (>= 1.3.2)
multi_xml (>= 0.5.2)
rack (>= 1.3.0)
rack-accept
rack-mount
virtus
gyoku (1.0.0)
builder (>= 2.1.2)
haml (4.0.4)
tilt
hashie (2.0.5)
hike (1.2.3)
http_parser.rb (0.6.0.beta.2)
httparty (0.12.0)
json (~> 1.8)
multi_xml (>= 0.5.2)
httpi (2.0.2)
rack
i18n (0.6.5)
ice_nine (0.10.0)
idp-clients (0.1.8.455)
activesupport
em-http-request
em-synchrony
faraday
faraday_middleware
savon (= 2.2.0)
idp-content_service_mock (0.0.1.495)
mirage (>= 3.0.0.alpha.10)
idp-user_service_mocks (0.1.3.460)
em-synchrony
eventmachine
idp-utilities (3.1.1.269)
childprocess
grape
net-ssh-gateway
sprockets
waitforit
watir-webdriver
json (1.8.1)
mini_portile (0.5.2)
minitest (4.7.5)
mirage (3.0.0.alpha.15)
childprocess
haml
hashie
httparty
ptools
sinatra
thor
waitforit
multi_json (1.8.2)
multi_xml (0.5.5)
multipart-post (1.2.0)
net-ssh (2.7.0)
net-ssh-gateway (1.2.0)
net-ssh (>= 2.6.5)
newrelic_rpm (3.6.8.168)
nokogiri (1.6.0)
mini_portile (~> 0.5.0)
nori (2.1.0)
page_object (2.2.0.15)
watir-webdriver
watir-webdriver
ptools (1.2.2)
rack (1.5.2)
rack-accept (0.4.5)
rack (>= 0.4)
rack-fiber_pool (0.9.3)
rack-mount (0.8.3)
rack (>= 1.0.0)
rack-protection (1.5.1)
rack
rack-test (0.6.2)
rack (>= 1.0)
rake (10.0.4)
rspec (2.13.0)
rspec-core (~> 2.13.0)
rspec-expectations (~> 2.13.0)
rspec-mocks (~> 2.13.0)
rspec-core (2.13.1)
rspec-expectations (2.13.0)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.13.1)
rubyzip (1.0.0)
savon (2.2.0)
akami (~> 1.2.0)
builder (>= 2.1.2)
gyoku (~> 1.0.0)
httpi (~> 2.0.2)
nokogiri (>= 1.4.0)
nori (~> 2.1.0)
wasabi (~> 3.1.0)
selenium-webdriver (2.37.0)
childprocess (>= 0.2.5)
multi_json (~> 1.0)
rubyzip (~> 1.0.0)
websocket (~> 1.0.4)
shotgun (0.9)
rack (>= 1.0)
simplecov (0.7.1)
multi_json (~> 1.0)
simplecov-html (~> 0.7.1)
simplecov-html (0.7.1)
sinatra (1.4.4)
rack (~> 1.4)
rack-protection (~> 1.4)
tilt (~> 1.3, >= 1.3.4)
sinatra-contrib (1.4.0)
backports (>= 2.0)
eventmachine
rack-protection
rack-test
sinatra (~> 1.4.2)
tilt (~> 1.3)
sinatra-reloader (1.0)
sinatra-contrib
sprockets (2.10.0)
hike (~> 1.2)
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
thin (1.5.1)
daemons (>= 1.0.9)
eventmachine (>= 0.12.6)
rack (>= 1.0.0)
thor (0.18.1)
thread_safe (0.1.3)
atomic
tilt (1.4.1)
tzinfo (0.3.38)
virtus (1.0.0)
axiom-types (~> 0.0.5)
coercible (~> 0.2)
descendants_tracker (~> 0.0.1)
equalizer (~> 0.0.7)
waitforit (0.0.1)
wasabi (3.1.0)
httpi (~> 2.0)
nokogiri (>= 1.4.0)
watir-webdriver (0.6.4)
selenium-webdriver (>= 2.18.0)
websocket (1.0.7)
PLATFORMS
ruby
DEPENDENCIES
childprocess
cucumber (= 1.2.5)
grape (= 0.6.0)
haml
hashie
httparty
idp-clients (~> 0.1.8)
idp-content_service_mock
idp-user_service_mocks
idp-utilities
mirage (= 3.0.0.alpha.15)
newrelic_rpm (~> 3.6.8.168)
page_object
rack-fiber_pool
rack-test
rake
rspec
shotgun
simplecov
sinatra
sinatra-contrib
sinatra-reloader
thin
waitforit
watir-webdriver
My Stackato.yml is
name: weblogin
instances: 1
framework:
type: rack
mem: 128
env:
RACK_ENV: preprod

activerecord-jdbc-adapter requires ActiveRecord at runtime error

So i just updated the JRUBY to 1.7.3 [1.9] and did a fresh gem install for the 1.9 version of ruby.
Here are the versions of my activerecord gems:
activerecord (1.6.0)
activerecord-jdbc-adapter (1.2.9)
ActiveRecord-JDBC (0.5)
activesupport (3.2.13)
When i try to execute a database statement i get the following error
activerecord-jdbc-adapter requires ActiveRecord at runtime
no such file to load -- active_record/version (LoadError)
anyone know what's going on? I have verified by using jgem list that these gems are all installed
Gemfile.lock
GEM
remote: http://rubygems.org/
specs:
ActiveRecord-JDBC (0.5)
Ascii85 (1.0.2)
activerecord (1.6.0)
activerecord-jdbc-adapter (1.2.9)
activesupport (3.2.13)
i18n (= 0.6.1)
multi_json (~> 1.0)
afm (0.2.0)
akami (1.2.0)
gyoku (>= 0.4.0)
nokogiri (>= 1.4.0)
bouncy-castle-java (1.5.0147)
builder (3.2.0)
business_time (0.6.1)
activesupport (>= 3.1.0)
tzinfo (~> 0.3.31)
childprocess (0.3.9)
ffi (~> 1.0, >= 1.0.11)
cucumber (1.2.3)
builder (>= 2.1.2)
diff-lcs (>= 1.1.3)
gherkin (~> 2.11.6)
multi_json (~> 1.3)
cuke_sniffer (0.0.3)
roxml
data_magic (0.14)
faker (>= 1.1.2)
yml_reader (>= 0.2)
diff-lcs (1.2.1)
faker (1.1.2)
i18n (~> 0.5)
ffi (1.6.0)
gherkin (2.11.6-java)
json (>= 1.7.6)
gyoku (1.0.0)
builder (>= 2.1.2)
hashery (2.1.0)
httpi (2.0.2)
rack
i18n (0.6.1)
jruby-openssl (0.8.7)
bouncy-castle-java (>= 1.5.0147)
jruby-win32ole (0.8.5)
json (1.7.7-java)
mime-types (1.21)
multi_json (1.7.2)
nokogiri (1.5.9-java)
nori (2.0.4)
page-object (0.8.6.1)
page_navigation (>= 0.7)
selenium-webdriver (>= 2.31.0)
watir-webdriver (>= 0.6.2)
page_navigation (0.7)
data_magic (>= 0.14)
pdf-reader (1.3.2)
Ascii85 (~> 1.0.0)
afm (~> 0.2.0)
hashery (~> 2.0)
ruby-rc4
ttfunk
rack (1.5.2)
rake (10.0.4)
rautomation (0.8.0)
ffi
rest-client (1.6.7)
mime-types (>= 1.16)
roxml (3.3.1)
activesupport (>= 2.3.0)
nokogiri (>= 1.3.3)
rspec (2.13.0)
rspec-core (~> 2.13.0)
rspec-expectations (~> 2.13.0)
rspec-mocks (~> 2.13.0)
rspec-core (2.13.1)
rspec-expectations (2.13.0)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.13.0)
ruby-debug-ide (0.4.16)
rake (>= 0.8.1)
ruby-ole (1.2.11.6)
ruby-rc4 (0.1.5)
rubyzip (0.9.9)
savon (2.1.0)
akami (~> 1.2.0)
builder (>= 2.1.2)
gyoku (~> 1.0.0)
httpi (~> 2.0.2)
nokogiri (>= 1.4.0)
nori (~> 2.0.3)
wasabi (~> 3.0.0)
selenium-webdriver (2.31.0)
childprocess (>= 0.2.5)
multi_json (~> 1.0)
rubyzip
websocket (~> 1.0.4)
sources (0.0.1)
spreadsheet (0.8.3)
ruby-ole (>= 1.0)
ttfunk (1.0.3)
tzinfo (0.3.37)
wasabi (3.0.0)
httpi (~> 2.0)
nokogiri (>= 1.4.0)
watir-webdriver (0.6.2)
selenium-webdriver (>= 2.18.0)
websocket (1.0.7)
xpath (1.0.0)
nokogiri (~> 1.3)
yml_reader (0.2)
PLATFORMS
java
DEPENDENCIES
ActiveRecord-JDBC
activerecord
activerecord-jdbc-adapter
builder
business_time
childprocess
cucumber
cuke_sniffer
ffi
gherkin
jruby-openssl
jruby-win32ole
json
mime-types
nokogiri
page-object
pdf-reader
rake
rautomation
rest-client
rspec
ruby-debug-ide
rubyzip
savon
selenium-webdriver
sources
spreadsheet
watir-webdriver
xpath
The first issue was your require statement,
Your second issue was using 1.6.0 which has been reported to throw this error. The solution is to remove AR 1.6.0 from your Gemfile.lock and install a newer version.
In your Gemfile add:
gem "activerecord", "~> 3.2.13"
then re-run bundler after fixing your Gemfile.lock

Resources