Using RVM, but can't set current Ruby version (Ubuntu 11.10)

后端 未结 4 638
时光取名叫无心
时光取名叫无心 2021-02-08 23:13

I have recently installed RVM on a fresh install of Ubuntu 11.10 and can not work out how to start using a particular ruby version.

I have installed Ruby 1.8.7 and 1.9.2

相关标签:
4条回答
  • 2021-02-08 23:44

    Have you added the following line to your .bash_profile,

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

    as the installation page for rvm says?

    0 讨论(0)
  • 2021-02-08 23:47

    Like tass suggested you obviously have a different rvm directory then $HOME/.rvm so

    [[ -s "/usr/share/ruby-rvm/scripts/rvm" ]] && . "/usr/share/ruby-rvm/scripts/rvm"
    

    is probably what you would to use instead

    0 讨论(0)
  • 2021-02-08 23:51

    I know this thread is zombie-old, but in your terminal client's preferences, checking 'run command as login shell' solved it for me. RVM generally puts that line in your ~/.bash_profile for you.

    0 讨论(0)
  • 2021-02-09 00:03

    RVM 1.6.9 is very old now. Did you install it through some package manager? If so, get rid of it and run the following in your bash shell:

    curl -L https://get.rvm.io | bash -s stable

    Then, place [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" in ~/.profile OR ~/.bash_profile OR ~/.bashrc

    You should then be able to run type rvm | head -n 1 and it should say "rvm is a function".

    Then you should be able to install rubies and use one of them. Be sure to use --default for that Ruby to remain the default even after you end your terminal session. E.g. rvm use ruby-1.9.2-p290 --default

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