DEV Community

Tao Liu
Tao Liu

Posted on • Edited on

1

Fix "Warning! PATH is not properly set up..." when running "rvm use 2.7.0 --default"

I ran rvm use 2.7.0 --default to switch to ruby 2.7.0

But ran into this error:

Warning! PATH is not properly set up, /home/tao/.rvm/gems/ruby-2.6.1/bin is not at first place.
Usually this is caused by shell initialization files. Search for PATH=... entries.
You can also re-add RVM to your profile by running: rvm get stable --auto-dotfiles
To fix it temporarily in this shell session run: rvm use ruby-2.6.1
To ignore this error add rvm_silence_path_mismatch_check_flag=1 to your ~/.rvmrc file.

Here's how to fix it, add rvm_silence_path_mismatch_check_flag=1 to your ~/.rvmrc file.

Now when running the command you will get:

// ♥ rvm use 2.7.0 --default

RVM is not a function, selecting rubies with 'rvm use ...' will not work.

You need to change your terminal emulator preferences to allow login shell.
Sometimes it is required to use /bin/bash --login as the command.
Please visit https://rvm.io/integration/gnome-terminal/ for an example.

To permanently fix the second error:

Add this into your VSCode settings.json file:

// Linux
"terminal.integrated.shellArgs.linux": ["-l"]

Source for the permanent fix: https://code.visualstudio.com/docs/editor/integrated-terminal

OR

Run: /bin/bash --login

Now rvm use 2.7.0 --default should work, and return the message:

Using /home/tao/.rvm/gems/ruby-2.7.0

Postmark Image

20% off for developers who'd rather build features than debug email

Stop wrestling with email delivery and get back to the code you love. Postmark handles the complexities of email infrastructure so you can ship your product faster.

Start free

Top comments (0)

Image of Datadog

Get the real story behind DevSecOps

Explore data from thousands of apps to uncover how container image size, deployment frequency, and runtime context affect real-world security. Discover seven key insights that can help you build and ship more secure software.

Read the Report

👋 Kindness is contagious

If this post resonated with you, feel free to hit ❤️ or leave a quick comment to share your thoughts!

Okay