RVM on Ubuntu Troubles

2019-08-29 11:44发布

问题:

I've run into a lot of issues whilst attempting to install RVM on Ubuntu 9.10. Here's the steps I've tried doing:

  • install ruby (via ruby site, no package manager)
  • download rvm
  • install rvm (make edit to .bashrc)
  • use rvm to install ruby version & gems

Is there any crucial step that I seem to be missing?

回答1:

Be sure to have selected an installed ruby (the --default portion tells rvm you want this ruby to be your default ruby version). Something like:

rvm --default use 1.9.2

Also this command will tell you which ruby is currently selected:

rvm list

And hopefully you'll see something like:

rvm rubies

   ruby-1.9.2-p0 [ x86_64 ]
=> ruby-1.8.7-p302 [ x86_64 ]

At this point, you'll be able to install gems and hopefully have a successful rvm install and working environment.

I've had issues in the past where I didn't have an rvm ruby selected and was still working with my distribution's ruby and gems and got mixed up easily. Make sure you're ruby and gem commands are working out of your ~/.rvm folder whith the following commands:

which ruby
which gem

Good luck!



回答2:

What are the issues you're running into? Sometimes I forget to switch into the correct rvm environment (e.g. rvm ree), so it helps to place a .rvmrc file in project directories.

I would start off by removing ubuntu's ruby installation so that you don't have to worry about conflicts (although rvm will setup your PATH correctly). Following the instructions at RVM, run the following command to install rvm,

  bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )

and then install system dependencies as listed in rvm notes. and then install the specific ruby version you want (e.g. rvm install ree or rvm install 1.9.1)



回答3:

Important : for a good installation try this :

type rvm | head -n1

Must return : rvm is a function

else add this line

[[ -s "/usr/local/rvm/scripts/rvm" ]] && . "/usr/local/rvm/scripts/rvm"

in your profile.



标签: ruby rvm