bash: /home/XXX/.rvm/scripts/rvm: No such file or directory

前端 未结 12 2084
南旧
南旧 2021-02-04 05:48

I just walk-through with the installation of Ruby on Rails on Ubuntu using RVM.

First I have logged in as the root user.

Then I started with the f

相关标签:
12条回答
  • 2021-02-04 06:25

    This source /usr/share/rvm/scripts/rvm works for me on ubuntu 20.04. I changed the local in /usr/local/rvm/scripts/rvm to share I assume that you have installed the rvm.

    0 讨论(0)
  • 2021-02-04 06:25

    Your surest bet is to use home brew. Funny part is if you try brew upgrade ruby, you will have an error if brew wasn't used to install ruby in the first instance so use:

    $ brew install ruby
    

    Then afterwards use

    $ brew upgrade ruby
    

    You may need to close and reopen your terminal to see the effect of the upgrade by typing

    $ ruby -v
    
    0 讨论(0)
  • 2021-02-04 06:28

    If you install rvm via apt-get you can add the following line into ~/.zshrc or ~/.bashrc

    source /etc/profile.d/rvm.sh
    
    0 讨论(0)
  • 2021-02-04 06:33

    I think they may have moved some files around fixed with:

    source /usr/share/rvm/scripts/rvm 
    
    0 讨论(0)
  • 2021-02-04 06:33

    Firstly no need to go for sudo access while installing rvm, just follow the very basic commands below

       $\curl -sSL https://get.rvm.io | bash -s stable
    

    This will install rvm.

       $ rvm list known
       # MRI Rubies
       [ruby-]1.8.6[-p420]
       [ruby-]1.8.7[-p374]
       [ruby-]1.9.1[-p431]
       [ruby-]1.9.2[-p320]
       [ruby-]1.9.3[-p545]
       [ruby-]2.0.0-p353
    

    Install a version of ruby as required.

       $ rvm install 2.0.0-p353
    

    Now you can use the version of ruby for which you need to install rails as a gem.

       $ rvm use 2.0.0
    

    Also you can make it default if you want so

       $ rvm use 2.0 --default
    

    Next you can install rails as a gem.

        $ gem install rails
    

    gems should never be installed with sudo access as they change from project to project. rvm helps in managing the different versions of ruby in one m/c. You can also use gemsets to isolate gems and specific versions from one application to another.

    0 讨论(0)
  • 2021-02-04 06:34

    just create ~/.rvm/scripts/rvm directories, then try to install rvm but make sure you are not logged in as root.

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