Gemtastic Gemtastic - 1 year ago 132
Ruby Question

RVM installed ruby not found after restart of shell Ubuntu 16

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.


rvm -v
gives me a nice little output:

rvm 1.27.0 (latest) by Wayne E. Seguin <>, Michal Papis <> []

but running
ruby -v
gem -v
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:// --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
curl -sSL | 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

What I've tried:

I've checked my
and my
and it's set up nicely with the following:


export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting


[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*

What kinda works:

Running the line
source ~/.rvm/scripts/rvm
, and
to be found again, but you have to repeat this is every new tab or window.

How can I fix so that
installed modules will work automatically?

Answer Source

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.

How to set this in the standard terminal on Ubuntu's standard GUI

(GNOME terminal Unity)

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download