Ruby and rbenv Cheat Sheet
Essential Ruby and rbenv Commands
Check Installed Ruby Version
Install Multiple Ruby Versions
List Installed Versions
Set Global Ruby Version
Set Local Ruby Version (Per Directory)
Update Shims (Ensure Commands Use the Correct Ruby Version)
Install a Gem System-Wide
Troubleshooting Running WPScan with Ruby 3.0.6 and Metasploit with Ruby 3.1.0
Step 1: Set Global Ruby Version for WPScan
To ensure WPScan runs with Ruby 3.0.6, set it as the global version:
Verify the active version:
Install WPScan:
Step 2: Configure Ruby 3.1.0 for Metasploit
To ensure Metasploit uses Ruby 3.1.0, set a local Ruby version inside its directory:
Running Metasploit from Any Directory
By default, msfconsole -q
will only work inside /usr/share/metasploit-framework
. To run it from anywhere, use one of these approaches:
Approach 1: Specify the Version Inline
Approach 2: Create a Wrapper Script (Recommended)
Modify your .zshrc
file:
Add the following function at the bottom:
Apply the changes:
Now, both wpscan
and msfconsole
can be used from anywhere in the system with their respective Ruby versions.