1

I’ve literally been trying to install metasploit for 2 days now and I think that's a ridiculous amount of time just to install some software. I have Arch linux and I am trying to install metasploit-git from AUR. I’ve followed the Arch linux metasploit guide, as well as this.

I’ve followed the guide all the way up to the point where I need to run bundle install. It successfully installs a handful of gems, but fails with this error:

Gem::InstallError: metasploit-concern requires Ruby version >= 2.1.
An error occurred while installing metasploit-concern (0.4.0), and Bundler cannot continue.
Make sure that `gem install metasploit-concern -v '0.4.0'` succeeds before bundling.

Here are some of the environment variables:

MY_RUBY_HOME=/home/me/.rvm/rubies/ruby-1.9.3-p551

RUBY_VERSION=ruby-2.2.1

PATH=/home/me/.rvm/gems/ruby-1.9.3-p551/bin:/home/me/.rvm/gems/ruby-1.9.3-p551@global/bin:/home/me/.rvm/rubies/ruby-1.9.3-p551/bin:/home/me/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/home/me/.gem/ruby/2.2.0/bin:/home/me/.rvm/bin:/home/me/.rvm/bin

GEM_HOME=/home/me/.rvm/gems/ruby-2.2.1

I see that some of the variables say ruby-1.9, but I’m not sure what to do about it. The output of ruby --version is:

ruby 1.9.3p551 (2014-11-13 revision 48407) [x86_64-linux]

I have ruby 2.2.1 installed so I don’t know why this is still showing as the the version.

It turns out that the problem was having multiple instances of

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"

Removing all but one in /etc/profile, and then running rvm use --default 2.2.1 fixed this.

1 Answers1

2

After 2 days of trial and error, I found a solution, follow the steps below but try it on a vm first. This worked for me on Kali linux hope it works for you. Before going ahead update your machine.

  1. git clone https://github.com/rapid7/metasploit-framework "folder_name"
  2. follow these steps to update ruby https://amionrails.wordpress.com/2014/02/10/install-rvm-ruby-on-rails-and-ruby-on-kali-linux/ follow all the steps upto installing rails
  3. ./msfupdate - check for error if it continues
  4. install these: apt-get install build-essential libreadline-dev libssl-dev libpq5 libpq-dev libreadline5 libsqlite3-dev libpcap-dev openjdk-7-jre git-core autoconf postgresql pgadmin3 curl zlib1g-dev libxml2-dev libxslt1-dev vncviewer libyaml-dev curl zlib1g-dev ruby-dev
  5. gem install bundle
  6. bundle install
  7. ./msfupdate

Next you will need to connect the database.

  1. start postgresql service if not running
  2. su - postgres
  3. createuser "user" -P -S -R -D
  4. createdb -O "user" msf
  5. exit
  6. return to home folder if currently accessing git clone folder
  7. cd .msf4/
  8. nano -w database.yml

add these lines to the file. production:
adapter: postgresql
database: msf
username: "user"
password: "password"
host: 127.0.0.1
port: 5432
pool: 75
timeout: 5


Then return to the msf folder (git clone folder) and run ./msfconsole

Apologies for this format, its my first solution and thanks to hak5 for the tutorial on installing metasploit from github and amionrails for tutorial on updating ruby. let me know if this works.

Nifle
  • 34,998
Adithya
  • 21