rapid7 / recog

Pattern recognition for hosts, services, and content

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

recog requires Ruby version >=2.1. even though its already present

Spik3Spi3g3l opened this issue · comments

Installing recog version 2.0.6 using the command sudo gem install recog -v '2.0.6' gives the following error:

ERROR:  Error installing recog:
    recog requires Ruby version >= 2.1.

even when Ruby version is >= 2.1.

Here's the output of ruby --version

$ ruby --version
ruby 2.3.0p0 (2015-12-25 revision 53290) [i686-linux]

and the output of gem env

$  gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 2.6.4
  - RUBY VERSION: 2.3.0 (2015-12-25 patchlevel 0) [i686-linux]
  - INSTALLATION DIRECTORY: /home/Spike/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0
  - USER INSTALLATION DIRECTORY: /home/Spike/.gem/ruby/2.3.0
  - RUBY EXECUTABLE: /home/Spike/.rbenv/versions/2.3.0/bin/ruby
  - EXECUTABLE DIRECTORY: /home/Spike/.rbenv/versions/2.3.0/bin
  - SPEC CACHE DIRECTORY: /home/Spike/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /home/Spike/.rbenv/versions/2.3.0/etc
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-linux
  - GEM PATHS:
     - /home/Spike/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0
     - /home/Spike/.gem/ruby/2.3.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /home/Spike/.rbenv/versions/2.3.0/bin
     - /home/Spike/.rbenv/libexec
     - /home/Spike/.rbenv/plugins/ruby-build/bin
     - /home/Spike/.rbenv/plugins/ruby-build/bin
     - /home/Spike/.rbenv/shims
     - /home/Spike/.rbenv/bin
     - /home/Spike/.rbenv/bin
     - /usr/local/bin
     - /usr/bin
     - /bin
     - /usr/local/games
     - /usr/games
     - /home/Spike/.rvm/bin
     - /home/Spike/.rvm/bin

Even the Ruby version for root is 2.3.0

# ruby --version
ruby 2.3.0p0 (2015-12-25 revision 53290) [i686-linux]
# gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 2.5.1
  - RUBY VERSION: 2.3.0 (2015-12-25 patchlevel 0) [i686-linux]
  - INSTALLATION DIRECTORY: /root/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0
  - USER INSTALLATION DIRECTORY: /root/.gem/ruby/2.3.0
  - RUBY EXECUTABLE: /root/.rbenv/versions/2.3.0/bin/ruby
  - EXECUTABLE DIRECTORY: /root/.rbenv/versions/2.3.0/bin
  - SPEC CACHE DIRECTORY: /root/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /root/.rbenv/versions/2.3.0/etc
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-linux
  - GEM PATHS:
     - /root/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0
     - /root/.gem/ruby/2.3.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /root/.rbenv/versions/2.3.0/bin
     - /root/.rbenv/libexec
     - /root/.rbenv/plugins/ruby-build/bin
     - /root/.rbenv/plugins/ruby-build/bin
     - /root/.rbenv/shims
     - /root/.rbenv/bin
     - /usr/local/sbin
     - /usr/local/bin
     - /usr/sbin
     - /usr/bin
     - /sbin
     - /bin

I noticed you installed the gem with sudo ...is there a particular reason for that? I believe that's why the appropriate ruby version cannot be found. Maybe try without sudo, just gem install recog -v '2.0.6' and hopefully it should work. You can see sudo gem env vs gem env usually represent different environments.

Yes, I've tried that and that does definitely work

$ gem install recog -v '2.0.6'
Successfully installed recog-2.0.6
Parsing documentation for recog-2.0.6
Done installing documentation for recog after 0 seconds
1 gem installed

However this fails in metasploit-framework:

/usr/share/metasploit-framework/tools$ bundle install
Fetching gem metadata from https://rubygems.org/
Fetching version metadata from https://rubygems.org/
Using rake 10.4.2
Using i18n 0.7.0
Using minitest 4.7.5
Using multi_json 1.11.1
Using thread_safe 0.3.5
Using tzinfo 0.3.44
Using builder 3.1.4
Using erubis 2.7.0
Using rack 1.5.5
Using activerecord-deprecated_finders 1.0.4
Using arel 4.0.2
Using bcrypt 3.1.10
Using docile 1.1.5
Using rkelly-remix 0.0.6
Using json 1.8.2
Using thor 0.19.1
Using pg 0.18.2
Using pg_array_parser 0.0.9
Using mini_portile 0.6.2
Using rubyntlm 0.5.0
Using rubyzip 1.1.7
Using metasploit-payloads 1.0.7
Using msgpack 0.6.0
Using packetfu 1.1.9
Using rb-readline-r7 0.5.2.0
Using robots 0.10.1
Using sqlite3 1.3.10
Using network_interface 0.0.1
Using pcaprub 0.12.0
Using simplecov-html 0.9.0
Using bundler 1.12.5
Using activesupport 4.0.13
Using rack-test 0.6.3
Using jsobfu 0.2.1
Using nokogiri 1.6.6.2
Using simplecov 0.9.2
Using activemodel 4.0.13
Using actionpack 4.0.13
Installing recog 2.0.6

Gem::InstallError: recog requires Ruby version >= 2.1.
Using activerecord 4.0.13
Using railties 4.0.13
An error occurred while installing recog (2.0.6), and Bundler cannot continue.
Make sure that `gem install recog -v '2.0.6'` succeeds before bundling.

This metasploit-framework is pretty out-of-date - the latest is on Ruby 2.3.1. Is this Kali 2.0? If so, you should upgrade to the kali rolling release.

Thanks. I've updated the Kali version. This helps. Closing the issue.

No problem, glad to help :)