Ads
Ads

Reputation: 277

RVM Command: source ~/.rvm/scripts/rvm

I'm going through the rails by example tutorial series. I'm trying my best to find solutions prior to asking questions, so if I have missed anything I apologise.

Every time I need to boot up RVM from the command line in terminal I need to punch a command so that RVM initialises: source ~/.rvm/scripts/rvm

Is this normal? It seems that I cant get the RVM commands to work unless I punch in this code prior. Note I only have to enter the command once, not every time I need to enter an RVM command.

Many thanks for your help.

Upvotes: 24

Views: 26594

Answers (4)

JoeB
JoeB

Reputation: 11

Try closing terminal and then re-opening it to install a specific version of Ruby as seen in this video at 2:32. For example, I typed curl -L https://get.rvm.io | bash -s stable --ruby

Then I quit and reopened the terminal, typed rvm install 2.2.3 and it worked.

Upvotes: 1

If your rvm command is not found:

  1. (to check, enter the command rvm list, which gives:)
/bin/bash: rvm: command not found

To solve it, follow these steps:

  1. Install rvm

  2. whereis rvm

rvm: /home/username/.rvm/bin/rvm 
  1. source ~/.rvm/bin/rvm

now test your rvm again

rvm list

Upvotes: 0

Mirko
Mirko

Reputation: 5286

Put this in your ~/.profile or ~/.bashrc:

# This loads RVM into a shell session.
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"

So you don't have to manually type it for every session.

Upvotes: 45

RonanOD
RonanOD

Reputation: 885

Further Tip

If you want to use gnome terminal (comes as standard in Ubuntu) with rvm, you can do the following:

  • Edit the default profile. Check the following setting:

    "Run command as a login shell"
    
  • This will stop loading the standard .bashrc by default. Fix this by making a soft link of .rvmrc pointing at .bashrc in your home directory

    cd
    ln -s .bashrc .rvmrc
    

Upvotes: 2

Related Questions