-1

when I do ruby -v it shows

The program 'ruby' can be found in the following packages:
* ruby1.8
* ruby1.9.1
Try: sudo apt-get install <selected package>

and

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.

and when i run /bin/bash --login and then run ruby -v it shows

ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-linux]

But i dont want to run /bin/bash --login command every time. I want my system to set ruby 2.1.0 as default ruby from rvm.

Akhil Latta
  • 528
  • 5
  • 13

1 Answers1

0

The problem is likely your login context. This is because ssh, by default, uses a different launch context than local bash shell. See here:

.bashrc at ssh login

You'll need to add the following to .bash_profile:

if [ -f ~/.bashrc ]; then
  . ~/.bashrc
fi

If you're using sudo su, etc, to change context, then you'll have to add the -l flag to establish the same context.

This answer is just a guess, it's hard to tell why your particular environment isn't loading, but this is a common cause.

Community
  • 1
  • 1
mostlydev
  • 715
  • 6
  • 16