RVM is not a function
While trying to change my ruby version with rvm use in VSCode with RVM I kept getting this error: RVM is not a function.
Login Shell
I found out that VSCode was not using a login shell for the terminal. In turn, this was not loading up the proper bash profile. Some people suggested modifying .bash_profile and .bashrc but many wanted to avoid modifying those files and going that route.
The Fix, Login Shell Launch Parameter
The fix ended up being rather simple after a long witch chase.
Go into VSCode’s settings and look for args. You should see shell args for the different operating systems.
Adding the following will allow the VSCode terminal to launch with a login shell. This fix also sounds like it is applicable to Linux.
"terminal.integrated.shellArgs.osx": ["-l"]
Resources
- RVM Installation is not working: “RVM is not a function”
- Allow integrated terminal to run as login shell
- Found this in the VSCode Documentation a couple of days later VSCode Integrated Terminal