Once again I’ve been playing around with metasploit and ruby on Yosemite and as a result I can run metasploit with ruby 2.1.4.

All I have to say is that it has been quite tricky but at the end I’ve got it working!
Here is an explanation, step by step, of what needs to be done to achieve the goal:

Assuming Homebrew is already installed into the system, use the terminal to run the following commands:

# brew update
# brew install rbenv ruby-build
# rbenv install 2.1.4
# rbenv global 2.1.4

To be sure the above commands had worked as expected a check is necessary running:

# ruby -v

The output must be:

ruby 2.1.4p265

Once ruby is configured to use 2.1.4 version, metasploit needs to be updated running the following command:

# msfupdate

This command will take a while to be executed but at the will be possible to run metasploit with:

# msfconsole

Enjoy the new setup.