For anyone looking for same settings for IntelliJ 2024.1.1 (2024 edition).
- Install Ruby (If not already installed.)
- Open the Project in IntelliJ.
- Go to File -> Project Structure.
- Click on SDKs under Project Settings.
- Click on the + icon.
- Select Add Ruby SDK.
- Select your installation of Ruby.
Screenshot for reference