Error when running msfconsole in Pentestbox - ruby

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

Related

I am not able to install any new gem in my rails application.Its a issue related to bundler

Bundler could not find compatible versions for gem "bundler":
In Gemfile:
rails (~> 5.2) was resolved to 5.2.3, which depends on
bundler (>= 1.3.0)
solargraph was resolved to 0.38.0, which depends on
bundler (>= 1.17.2)
Current Bundler version:
bundler (1.16.2)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?
Could not find gem 'bundler (>= 1.17.2)', which is required by gem 'rails (~> 5.2)', in any of the sources.
ERROR: 6
I am using ruby version 2.5.1 on my device and rvm is not installed earlier the version of ruby 3.0.2 but our project is of version 2.5.1. But while installing any new gem and hitting bundle install it shows this particular error
sudo docker-compose run --rm --no-deps web bundle install

Unable to install bundler with gem

I am using ruby 2.6.5 and I try to install bundler -v 2.2.27 gem according to documentation using this command:
gem install bundler -v 2.2.27 --default
And this is the output I get:
gem install bundler -v 2.2.27 --default
Successfully installed bundler-2.2.27 as a default gem
ERROR: While executing gem ... (Errno::ENOENT)
No such file or directory # dir_chdir - /Users/jedrek/.rvm/gems/ruby-2.6.5/specifications/gems/bundler-2.2.27
It says it installed the gem but errors out at the same time :)
When I check current version of bundler I get this output
gem info bundler
*** LOCAL GEMS ***
bundler (2.2.32, 2.2.27, 2.2.24, 2.1.4)
Authors: André Arko, Samuel Giddins, Colby Swandale, Hiroshi
Shibata, David Rodríguez, Grey Baker, Stephanie Morillo, Chris
Morris, James Wen, Tim Moore, André Medeiros, Jessica Lynn Suttles,
Terence Lee, Carl Lerche, Yehuda Katz
Homepage: https://bundler.io
License: MIT
Installed at (2.2.32): /Users/jedrek/.rvm/gems/ruby-2.6.5
(2.2.27, default): /Users/jedrek/.rvm/rubies/ruby-2.6.5/lib/ruby/gems/2.6.0
(2.2.24): /Users/jedrek/.rvm/gems/ruby-2.6.5
(2.1.4): /Users/jedrek/.rvm/gems/ruby-2.6.5
As you can see it says that bundler -v 2.2.27 is installed.
When I try to install dependencies in my project I get this error:
bundle install
Resolving dependencies...
Bundler could not find compatible versions for gem "bundler":
In Gemfile:
bundler (~> 2.2.27)
Current Bundler version:
bundler (2.1.4)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?
Could not find gem 'bundler (~> 2.2.27)' in any of the relevant sources:
the local ruby installation
Listing current bundler version locally shows this output
gem list bundler
*** LOCAL GEMS ***
bundler (2.2.32, default: 2.2.27, 2.2.24, 2.1.4)
bundler-audit (0.7.0.1, 0.6.1)
capistrano-bundler (2.0.1, 1.3.0)
I am so confused. Is this is a bug?
I am using rubygems 3.2.27
gem --version
3.2.27
UPDATE
I tried upgrading rubygems to 3.2.32 and have the same issue.

Gem::InstallError: nokogiri requires Ruby version < 2.7.dev, >= 2.3 on Pentestbox

when I try to run metasploit on pentestbox last version I get the below error
could not find compatible versions for gem "activesupport": In snapshot (Gemfile.lock): activesupport (= 4.2.11) In Gemfile: metasploit-framework x86-mingw32 was resolved to 5.0.5, which depends on activerecord (~> 4.2.6) x86-mingw32 was resolved to 4.2.10, which depends on activesupport (= 4.2.10) x86-mingw32 rspec-rails x86-mingw32 was resolved to 3.8.2, which depends on railties (>= 3.0) was resolved to 4.2.11, which depends on activesupport (= 4.2.11) x86-mingw32 Running bundle update will rebuild your snapshot from scratch, using only the gems in your Gemfile, which may resolve the conflict.
I tried running the command "bundle update", but got this error
Fetching nokogiri 1.10.1 (x86-mingw32) Installing nokogiri 1.10.1 (x86-mingw32) Gem::InstallError: nokogiri requires Ruby version < 2.7.dev, >= 2.3. An error occurred while installing nokogiri (1.10.1), and Bundler cannot continue. Make sure that gem install nokogiri -v '1.10.1' succeeds before bundling
after that I try run command "bundle install" I get same Error
I also got the same error in my Windows 10 and I was able to install the nokogori successfully. Below is my Ruby environment.
RubyGems Environment:
- RUBYGEMS VERSION: 2.4.5
- RUBY VERSION: 2.2.2 (2015-04-13 patchlevel 95) [x64-mingw32]
- INSTALLATION DIRECTORY: C:/Ruby222-x64/lib/ruby/gems/2.2.0
- RUBY EXECUTABLE: C:/Ruby222-x64/bin/ruby.exe
- EXECUTABLE DIRECTORY: C:/Ruby222-x64/bin
- SYSTEM CONFIGURATION DIRECTORY: C:/ProgramData
- RUBYGEMS PLATFORMS:
- ruby
- x64-mingw32
- GEM PATHS:
- C:/Ruby222-x64/lib/ruby/gems/2.2.0
To solved the issue I just updated my Gemfile. I added this line:
gem 'nokogiri', '~> 1.6.8'
I am using Windows 10, I installed nokogiri prerelease version in which this is fixed.
gem inst nokogiri --pre
Then I changed the dependency in the gemfile.lock file:
nokogiri (1.11.0.rc2-x64-mingw32)
Reference:
https://github.com/sparklemotion/nokogiri/issues/1961

How to launch calabash-android on OS X? (Ruby gems dependency error)

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

Ruby can't find installed gems windows 10

When running a script containing the following
require 'rubygems'
require 'zip'
I am getting
`require': cannot load such file -- zip
First I have tried to install like this 'rubyzip'
gem install rubyzip
When looking at the gem env:
>gem env
RubyGems Environment:
RUBYGEMS VERSION: 2.4.8
RUBY VERSION: 2.2.3 (2016-01-26 patchlevel 0) [java]
INSTALLATION DIRECTORY: C:/jruby-9.0.5.0/lib/ruby/gems/shared
RUBY EXECUTABLE: C:/jruby-9.0.5.0/bin/jruby.exe
EXECUTABLE DIRECTORY: C:/jruby-9.0.5.0/bin
SPEC CACHE DIRECTORY: C:/Users/lucio/.gem/specs
SYSTEM CONFIGURATION DIRECTORY: C:/jruby-9.0.5.0/etc
RUBYGEMS PLATFORMS:
- ruby
- universal-java-1.8
GEM PATHS:
- C:/jruby-9.0.5.0/lib/ruby/gems/shared
- C:/Users/lucio/.gem/jruby/2.2.0
in the irb seems like the require works
irb(main):001:0> require 'zip'
=> true
I also trying to install with bundler after installing
>bundle show
Gems included by the bundle:
* bundler (1.12.4)
* rubyzip (1.2.0)
but when running my script I get
>bundler exec ruby zip.rb
Could not find rubyzip-1.2.0 in any of the sources
Run `bundle install` to install missing gems.
I can also see it in the gem list
>gem list -l
*** LOCAL GEMS ***
bundler (1.12.4)
jar-dependencies (0.2.3)
jruby-openssl (0.9.15 java)
jruby-win32ole (0.8.5)
json (1.8.0 java)
minitest (5.4.1)
power_assert (0.2.3)
psych (2.0.15 java)
racc (1.4.13 java)
rake (10.1.0)
rdoc (4.1.2)
rubygems-update (2.6.4)
rubyzip (1.2.0)
Can anybody help ?
Found the problem.
I had Jruby installed along with Ruby, so when installing the gem it will automatically install under the Jruby directory and later won't be found by Ruby removing the Jruby from PATH end variable solved the problem

Resources