Ubuntu RVM Rails bash command not found

后端 未结 2 877
挽巷
挽巷 2021-02-06 11:01

I just installed ubuntu, and after that I wanted to install RVM with ruby and rails 3.1.

Installations went fine but when I want to create a rails app it can\'t find the

2条回答
  •  借酒劲吻你
    2021-02-06 11:45

    You need to

    Add rvm to your .bashrc by adding a line like

    [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
    

    This will allow you to load rvm when you start a new bash session

    create a new Gemset when you want a new rails.

    The work flow should work like this

    $ mkdir new_rails_app
    $ cd new_rails_app
    $ vim .rvmrc
    
    # edit the .rvmrc to use the correct Gemset Something like 
    rvm use ruby-1.9.2-p180@new_rails_app --create
    
    #save and exit vim
    
    $ rvm rvmrc load
    # you should see a prompt that your Gemset was loaded
    
    $ gem install rails
    $ rails new .
    

    You now have a working rails directory for a new app using rvm. There are other little tricks like auto loading your rvmrc's but I left that out just for the sake of the "easiest" route.

提交回复
热议问题