How to change Ruby to version 1.9.3 (again) using RVM?

I used to work with Ruby version 1.9.3 on Ubuntu and did an update that probably screwed up my bash profile, and I need help to get it back, and not use version 1.8.7. Right now, rails s opening a server with Ruby 1.8.7, and I am getting errors due to the more syntax that I use in my application.

.bash_profile :

 cat ~/.bash_profile ### Added by the Heroku Toolbelt export PATH="/usr/local/heroku/bin:$PATH" [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function* 

which rails :

 /usr/local/bin/rails 

which ruby :

 /usr/bin/ruby 

ruby -v :

 ruby 1.8.7 (2011-06-30 patchlevel 352) [i686-linux] 

rvm list :

 rvm rubies =* ruby-1.9.3-p194 [ i686 ] # => - current # =* - current && default # * - default 

rvm use 1.9.3 :

 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 a example. 
+4
source share
1 answer

You are not in the login shell. To enter the login shell, try the following command:

 /bin/bash --login 

After that, you can use RVM to select Ruby.

In addition, there is a constant way that you do not have to write this line every time you open your terminal. Try the following:

 Edit menu -> Profile Preferences 

A dialog box will appear, now select Run command in login shell .

After that, whenever you open your terminal, you will enter the login shell and you will be able to use RVM.

There is another way, you can write /bin/bash --login in your .bash_profile , which will load every time you reboot.

+15
source

Source: https://habr.com/ru/post/1444200/


All Articles