RVM is not a function, selecting rubies with 'rvm use ...' will not work

14,651

Solution 1

This will work,add these lines to your ~/.bashrc file manually

export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"

Solution 2

run:

rvm get stable --auto-dotfiles

make sure you read all the output - rvm prints information and warnings for you that you can fix any problems that can not be fixed automatically

Share:
14,651

Related videos on Youtube

Zeynel
Author by

Zeynel

Updated on September 18, 2022

Comments

  • Zeynel
    Zeynel over 1 year

    I am trying to install Discourse as explained here but the command

    # Use installed ruby as default
    rvm use 2.0.0 --default 
    

    results in this:

    discourse@ubuntu:~$ rvm use 2.0.0 --default
    
    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.
    

    I understand that

    For RVM to work properly, you have to set the 'Run command as login shell' checkbox on the Title and Command tab inside of gnome-terminal's Settings page.
    

    as explained here but I don't have access to GUI, because I am installing through ssh to the ubuntu server. How can I change that setting in gnome?



    EDIT

    As per mpapis' answer I ran rvm get stable --auto-dotfiles but I still get the same error. I include the output below. Does this tell me about anything to fix?

    discourse@ubuntu:/var/www/discourse$ rvm get stable --auto-dotfiles
    Downloading https://get.rvm.io
    Turning on auto dotfiles mode.
    Downloading https://github.com/wayneeseguin/rvm/archive/stable.tar.gz
    
    Upgrading the RVM installation in /home/discourse/.rvm/
        Removing rvm PATH line from /home/discourse/.profile /home/discourse/.bashrc /home/discourse/.zshrc.
        Adding rvm PATH line to /home/discourse/.profile /home/discourse/.bashrc /home/discourse/.zshrc.
        Removing rvm loading line from /home/discourse/.profile /home/discourse/.zlogin.
        Adding rvm loading line to /home/discourse/.bash_profile /home/discourse/.zlogin.
    Upgrade of RVM in /home/discourse/.rvm/ is complete.
    
    # discourse,
    #
    #   Thank you for using RVM!
    #   We sincerely hope that RVM helps to make your life easier and more enjoyable!!!
    #
    # ~Wayne, Michal & team.
    
    In case of problems: http://rvm.io/help and https://twitter.com/rvm_io
           Help RVM 2.0: https://www.bountysource.com/fundraisers/489-rvm-2-0
    
    Upgrade Notes:
    
      * No new notes to display.
    
    RVM reloaded!
    
  • Zeynel
    Zeynel over 10 years
    I still get the same error. I updated my question with the output, if you want to take a look. Thanks.
  • mpapis
    mpapis over 10 years
    close the ssh connection and connect again, do you login directly to the user or use su or sudo to change user?
  • bjmc
    bjmc almost 10 years
    Logging out and then SSHing in again fixed this issue for me. Thanks.