I'm not a ruby master, but it looks like some syntax got messed up. Hopefully, the maintainer will get this fixed. Until then, I was able to work around this by commenting out the LoadError section of:
/usr/share/metasploit-framework/Rakefile
rescue LoadError
#puts "rspec not in bundle, so can't set up spec tasks. " \
# "To run specs ensure to install the development and test groups."
#puts "Bundle currently installed '--without #{Bundler.settings.without.join(' ')}'."
#puts "To clear the without option do `bundle install --without ''` (the --without flag with an empty string) or " \
# "`rm -rf .bundle` to remove the .bundle/config manually and then `bundle install`"
puts "LoadError section commented out."
else