I have a jenkins job that right now is just trying to run a simple ruby script. However it is failing at require 'net/ssh/shell
In Jenkins I have:
gem install net-ssh -v 2.0
gem install net-ssh-shell
gem uninstall net-ssh --version 2.1.4
In ruby I have
gem 'net-ssh', '=2.0.0'
require 'net/ssh'
require 'net/ssh/shell'
But when I run the script I get this error:
Gem::LoadError: Unable to activate net-ssh-shell-0.2.0, because net-ssh-2.0.0 conflicts with net-ssh (~> 2.1.0)
raise_if_conflicts at /usr/local/rbenv/versions/jruby-1.7.4/lib/ruby/shared/rubygems/specification.rb:1637
activate at /usr/local/rbenv/versions/jruby-1.7.4/lib/ruby/shared/rubygems/specification.rb:746
try_activate at /usr/local/rbenv/versions/jruby-1.7.4/lib/ruby/shared/rubygems.rb:212
require at /usr/local/rbenv/versions/jruby-1.7.4/lib/ruby/shared/rubygems/custom_require.rb:59
require at /usr/local/rbenv/versions/jruby-1.7.4/lib/ruby/shared/rubygems/custom_require.rb:55
(root) at sparse_databases/refresh_sparse.rb:4
I have tried not specifying which version of net-ssh to install, not uninstalling 2.1.4.
Related
In PENTESTBOX I want to run METASPLOIT-FRAMEWORK by running command msfconsole
and it is giving the following error ``
Bundler could not find compatible versions for gem "ruby ":
In Gemfile:
ruby x86-mingw32
metasploit-framework x86-mingw32 was resolved to 5.0.83, which depends on
ruby (>= 2.5) x86-mingw32
Could not find gem 'ruby (>= 2.5)', which is required by gem 'metasploit-framework', in any of the relevant sources:
the local ruby installation
To fix your issue run
gem install bundler -v 1.12
bundle _1.12_ install
I've successfully generated file tree via calabash-android gen
After that I've tried to run tests:
calabash-android run ../app/build/outputs/apk/app-debug.apk
But got error:
Unable to activate calabash-android-0.9.0, because json-2.0.2 conflicts with json (~> 1.8) (Gem::ConflictError)
I've installed json 1.8.6 via gem install 'json' -v 1.8.6
and now gem list json outputs me
*** LOCAL GEMS ***
json (default: 2.0.2, 1.8.6)
multi_json (1.12.1)
But error Unable to activate calabash-android-0.9.0, because json-2.0.2 conflicts with json (~> 1.8) (Gem::ConflictError) throwed again. Where I am wrong?
UPD
I've tried to solve problem as described here github.com/calabash/calabash-ios/issues/1260 but osx says that I cant remove 2.0.2 version because it's default
MacBook-Pro-MacBook:calabash zub3r$ gem uninstall -Vax --force --no-abort-on-dependent json
ERROR: While executing gem ... (Gem::InstallError)
json is not installed in GEM_HOME, try:
gem uninstall -i /Users/zub3r/.rvm/gems/ruby-2.4.0#global json
MacBook-Pro-MacBook:calabash zub3r$ gem uninstall -i /Users/zub3r/.rvm/gems/ruby-2.4.0#global json
You have requested to uninstall the gem:
json-1.8.6
calabash-android-0.9.0 depends on json (~> 1.8)
cucumber-1.3.20 depends on json (~> 1.7, development)
luffa-2.0.0 depends on json (~> 1.8)
If you remove this gem, these dependencies will not be met.
Continue with Uninstall? [yN] ^CERROR: Interrupted
MacBook-Pro-MacBook:calabash zub3r$ gem uninstall -i /Users/zub3r/.rvm/gems/ruby-2.4.0#global json --version 2.0.2
ERROR: While executing gem ... (Gem::InstallError)
gem "json" cannot be uninstalled because it is a default gem
Problem solved by using bundler
bundle init
Gemfile content replaced with
# frozen_string_literal: true
source "https://rubygems.org"
gem 'calabash-android'
then
bundle install
I was facing same issue,I had downgraded my ruby version and it got solved.
Please find the solution below
$ gem -v
2.0.3
$ gem list rubygems-update
$ gem uninstall -v 2.0.3 rubygems-update
$ gem install -v 1.8.24 rubygems-update
$ update_rubygems
$ gem -v
1.8.24
I'm working on a Ruby script, it's not a web or Rails app. It's working well locally with Capybara and PhantomJS but I don't know how to run it after pushing to a Ruby 2.0 app in Openshift.
I ssh to app-root/repo and tried bundle install --without development, but it outputs:
Gem::InstallError: mime-types requires Ruby version >= 1.9.2.
An error occurred while installing mime-types (2.99), and Bundler cannot continue.
Make sure that `gem install mime-types -v '2.99'` succeeds before bundling.
Gemfile is:
source "https://rubygems.org"
gem "capybara"
gem "poltergeist"
gem "mailgun"
group :development do
gem "selenium-webdriver"
gem "chromedriver-helper"
gem "launchy"
end
Gemfile.lock was generated locally and pushed. Local Ruby is RVM 2.0, on Ubuntu 14.04 LTS.
It's most likely something simple but I've never used Openshift. Does anyone have any ideas?
ruby -v is ruby 2.0.0p645 (2015-04-13) [x86_64-linux].
which ruby is /opt/rh/ruby200/root/usr/bin/ruby.
which bundler is /usr/bin/bundler.
I am using ruby 1.8.7 (2013-06-27 patchlevel 374) [i686-darwin14]. When I try to install the capistrano gem I get the following error:
sudo gem install capistrano -v2.13.5
ERROR: Error installing capistrano:
net-ssh requires Ruby version >= 2.0.
AFAIK capistrano 2.13.5 should be compatible with ruby 1.8.7
How can I install capistrano v2.13.5 with ruby 1.8.7 (<2.0) installed?
I have sorted this problem out manually installing the capistrano dependencies. Execute the following commands if you have the same problem:
sudo gem install net-sftp -v2.0.0
sudo gem install net-scp -v1.0.0
sudo gem install net-ssh-gateway -v1.1.0
sudo gem install capistrano -v2.13.5
I had the same error message when installing Capifony in Ubuntu 14.04.
I did this:
# gem install net-ssh -v 2.9.2
And then this:
# gem install capifony
It worked.
I found the solution described here.
Even after installing the dependancies the capistrano installation process was asking for net-ssh that required ruby >= 2.
I had to download the source that I wanted from https://github.com/capistrano/capistrano/releases. Unzip, cd into the directory, and run:
gem build capistrano.gemspec
gem install --local capistrano-2.15.5.gem
Capistrano is trying to install latest version of its dependency (net-ssh) which is not compatible with ruby versions prior v2.0. The solution is to install proper version of that dependency prior to installing capistrano. Proper version means the dependency is compatible with both Ruby and capistrano. In this case that is net-ssh v 2.6.5. So following sequence works:
gem install net-ssh -v 2.6.5
gem install capistrano -v 2.13.5
I have been attempting to install the httparty gem, but the install fails with:
Error installing httparty:
httparty requires Ruby version >=1.9.3
My ruby version, from running ruby -v, is 1.9.3p448
Running gem env yields:
RUBYGEMS VERSION: 2.0.7
RUBY VERSION: 1.9.3
INSTALLATION DIRECTORY: .../ruby 1.9.3-p448/bin/ruby
RUBY EXECUTABLE: .../ruby-1.9.3-p448/bin
GEM PATHS:
.../gems/ruby-1.9.3-p448
.../ruby-1.8.3-p448#global
Any ideas why this is failing & what i can to to fix it, short of manually editing the gem to remove the 1.9.3 requirement?
This seems to me like it isn't using Ruby 1.9.3 as that is exactly what the error says. I had the same error message today when pushing to Heroku:
Installing httparty (0.12.0)
Gem::InstallError: httparty requires Ruby version >= 1.9.3.
An error occurred while installing httparty (0.12.0), and Bundler cannot
continue.
Make sure that `gem install httparty -v '0.12.0'` succeeds before bundling.
I just added
ruby '1.9.3'
to the top of my Gemfile like so:
source 'http://rubygems.org'
ruby '1.9.3'
gem 'rails', '3.0.20'
and all is well.