简体   繁体   中英

ruby/rails setup on ubuntu

I created a new VM using virtualbox and ubuntu 14. I then installed rvm using the following...

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

I'm still quite new to ubuntu/linux so I'm trying to get a handle on the terminal commands. So, I think that I first did a

sudo su -

thinking that this would allow me to specify my password once and then remember it for each command. But now I'm thinking that it instead changed me to the root account instead of my own? The reason I suspect this is because when I first open a terminal under my account and type in ruby -v, I get..

The program 'ruby' can be found in the following packages:
* ruby
* ruby 1.8
Try: sudo apt-get install <selected package>

If I then do a sudo su - and follow it with ruby -v, I get

ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-linux]

So, I'm not sure if I've done something wrong with the rvm installation or if there's some way to get my own account to use the same version of ruby as root? Thanks.

From the comments, you seem to have installed RVM as root. Doing that will make RVM and its rubies only "visible" to the root user. (Actually installing RVM for any user only makes it visible to that specific user AFAIK).

To fix that, first remove the root RVM installation, run sudo su - to become root (if you aren't already - to check what user you are you can run whoami ). Then run the following:

rvm implode

This removes RVM altogether.

Next exit to become a normal user (again, check with whoami , if you're stuck just open a new terminal window) and run the RVM installation command:

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

This should get you out of your problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM