Follow the below commands one by one
apt-get update
apt-get install curl git ruby build-essential ruby-sqlite3 libsqlite3-dev libssl-dev
curl https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer
source /etc/profile.d/rvm.sh
rvm pkg install zlib --verify-downloads 1
rvm install ruby-1.9.3-p545
rvm use 1.9.3
gem install bundler
git clone git://github.com/beefproject/beef.git
cd beef/
bundle install
ruby beef