I've installed RVM and ruby and at first it seemed to work, but whenever I open a new shell tab or window only rvm can be found, not ruby.
Running rvm -v
gives me a nice little output:
rvm 1.27.0 (latest) by Wayne E. Seguin <[email protected]>, Michal Papis <[email protected]> [https://rvm.io/]
but running ruby -v
, gem -v
or rails -v
gives me an error telling me to apt-get install ruby/rails
.
I've installed rvm through the following commands:
sudo apt-get install libgdbm-dev libncurses5-dev automake libtool bison libffi-dev
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
curl -sSL https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
I installed ruby like so:
rvm install 2.3.1
rvm use 2.3.1 --default
Rails was installed with the command:
gem install rails
I've checked my .bashrc
.bash_profile
and my .profile
and it's set up nicely with the following:
.bashrc
and .profile
:
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
.bash_profile
:
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
Running the line source ~/.rvm/scripts/rvm
allows ruby
, gem
, and rails
to be found again, but you have to repeat this is every new tab or window.
rvm
installed modules will work automatically?Turns out everything is set up nicely and correct. If you have this issue it's an issue with your shell settings. You need to set your profile to login shell.
Access your settings by going to the menu and pic Terminal > Preferences
.
In the window that pops up, select Profiles
in the tab menu. Pick if you want to create a new profile or edit the existing default one. In the window that comes up (it's the same regardless of your pic) go to the tab Command
and enable Run command as a login shell
.
Restart your terminal and you should find that your rvm commands are now working.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With