2

I have encountered 3 problems while following this guide to installing Metasploit Framework on Ubuntu and Debian:

1) After installing proper version of ruby, there is a command given for installing Ruby libraries: sudo gem install bundler. When I typed that in and hit enter, it says "command not found". After some researching on the internet, I decided to remove sudo and try again. So I've entered gem install bundler and it worked fine. Will this cause any problems?

2) After installing Metasploit Framework, there is a command given to install the required gems and versions:

cd metasploit-framework
bundle install

But when I tried that, I got this error:

rbenv: version '2.1.6' is not installed

I really don't know what to do next (But I moved on).

3) Probably due to the previous problems, in the end when I executed msfconsole command, it said

could not find rake-10.4.2 in any of the sources.

run bundle install to install the missing gems

But the bundle install doesn't help either, because when I run that it says

Could not locate Gemfile or .bundle/directory

Any help would be appreciated.

EDIT: When I asked the person himself who had written the guide, regarding this, he told me to select the version of ruby I had just installed with either rebind or RVM before installing bundler, and then to run the bundle install. Could you please list the commands to do so? I am really new to Linux!

Praveen Kumar
  • 413
  • 1
  • 6
  • 15
  • I am not using RVM but rbenv (the other ruby version control tool which I think is superior to RVM), but you can select ruby version by 'rvm install 2.1.2' and then 'rvm 2.1.2' for setting ruby version in current session or 'rvm --default 2.1.2' for permanent version selection. Please reopen terminal (open new terminal) to test the switch. – andrej May 18 '15 at 11:17

3 Answers3

2

step 1 :

sudo apt-get update
sudo apt-get upgrade

step 2 :

Install dependent packages

sudo 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

step 3 :

Install Ruby

curl -L https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
echo "source ~/.rvm/scripts/rvm" >> ~/.bashrc
source ~/.bashrc
rvm install 2.1.6
rvm use 2.1.6 --default
ruby -v

step 4 :

Install and configure postgresql

sudo apt-get install postgresql

sudo -s
su postgres

createuser msf -P -S -R -D
createdb -O msf msf
exit

Step 5 :

Install Metasploit Framework

cd /opt
sudo git clone https://github.com/rapid7/metasploit-framework.git
sudo chown -R `whoami` /opt/metasploit-framework
cd metasploit-framework
cd metasploit-framework
sudo bash -c 'for MSF in $(ls msf*); do ln -s /opt/metasploit-framework/$MSF /usr/local/bin/$MSF;done'

Still if you are facing any issue, you can download the iso or vm image from kali wesbite

Mr.Geek
  • 23
  • 4
0

I have this problem in kali after install metasploit-framework, and i can't run msfconsole. I solved the problem using the following method: At change your directory to /usr/share/metasploit-framework:

    cd /usr/share/metasploit-framework

and after that, install bundler with gem:

    gem install bundler

then:

    bundle install

at the end you need to update:

    gem update --system

and it will work!

TERMINATOR
  • 1,180
  • 1
  • 11
  • 24
-1

This command fixes it:

apt-get install ruby2.1-dev &&\
apt-get install libsqlite3-dev &&\
bundle install

What it does: install ruby development items

J. Chomel
  • 8,193
  • 15
  • 41
  • 69
Ali
  • 368
  • 3
  • 8