You may hit this error sometimes when executing msfconsole (usually after update metasploit)
You must use Bundler 2 or greater with this lockfile.
Following this post.
# Install gem 3.2.0 from source (3.0.6, 3.1.2 proved not working) git clone https://github.com/rubygems/rubygems cd rubygems ruby setup.rb # Then repair ruby env apt install ruby-dev -y apt install libpq-dev libpcap-dev libsqlite3-dev -y cd /usr/share/metasploit-framework/ sed -i 's#https://rubygems.org#https://gems.ruby-china.com#' Gemfile bundler install --no-deployment gem install json -v '2.3.0'
If things going right，the msf should be working not.
BUT, You may hit this error in the
bundler install step:
Error Message: '/usr/include/oracle/19.6/client/oci.h' does not exist. Install 'Instant Client SDK'.
Found this comment:
Which is pretty clear what we should do:
apt-get install oracle-instantclient-devel
Then try it again
gem install ruby-oci8 -v '2.2.8' --source 'https://mirrors.tuna.tsinghua.edu.cn/rubygems/'
It should be working now.