“RVM is not a function” error

后端 未结 10 1776
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-30 22:22

RVM is installed on my machine (running Mac OSX 10.6.8), correctly and it runs fine. The odd thing is that to run it, I have to use source ~/.rvm/scripts/rvm for ev

相关标签:
10条回答
  • 2021-01-30 22:46

    None of these solutions seemed to redeem my problem which was on Ubuntu 12.04 LTS.

    What I did is the following:

    1. rvm get stable --auto-dotfiles as outlined in the RVM documentation here
    2. Added source ~/.profile as the first line of: ~/.bash_profile

    I will not all of these steps were documented as errors from the RVM command line:

    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.

    and

    • WARNING: You have '~/.profile' file, you might want to load it, to do that add the following line to '/home/user_name/.bash_profile':

      source ~/.profile

    0 讨论(0)
  • 2021-01-30 22:51

    You shouldn't need to edit anything as others suggest. Just go into your terminal's settings and select the "Run command as login shell". This will cause .profile to run on the next terminal instance. Reopen your terminal and you should be able to use rvm use 1.9.3 (or whatever version you installed).

    More info found on rvm.io (which is also a great place for answers)

    https://rvm.io/integration/gnome-terminal

    0 讨论(0)
  • 2021-01-30 22:58

    What was screwing me up was assuming my path was correct since I was using one I can run manually.

    Apparently there are different executables or scripts that can be used and are located in different places.

    I thought that the path Mina should use was this:

     /usr/local/rvm/bin/rvm
    

    When in reality it was this:

    /usr/local/rvm/scripts/rvm
    
    0 讨论(0)
  • 2021-01-30 22:59

    I had the same issue. I found the .profile file was not getting updated, so i added the same command that was added into .bash_profile:

    [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"

    I don't know if this is the right way, but it worked...

    0 讨论(0)
提交回复
热议问题