0

After becoming root (with su root), ruby automatically falls back to old version which is 1.9.2-p180. After exit from root, the ruby is automatically back to newer version which is 1.9.2-p290.

rvm is installed on the system and p290 was installed with rvm. p180 was installed with apt-get.

Any thoughts? Thanks.

1
  • 1
    If root is using the system ruby then maybe you're initializing root's environment to use rvm? Commented Nov 3, 2011 at 15:18

3 Answers 3

4

Since the root user has a different environment from your regular user, you probably want to use rvmsudo whenever you're using rvm in a root context. This command specifically preserves the version of Ruby currently in use.

Sign up to request clarification or add additional context in comments.

3 Comments

rvmsudo use 1.9.2 --default with error: rvmsudo command not found.
rvmsudo is the same as sudo with the rvm environment preserved. You would do: rvmsudo {command} or in this case rvmsudo rvm use 1.9.2 --default
rvmsudo rvm use 1.9.2 --default did install gem bundler, as regular user (instead as a root). Thanks.
1

use .rvmc in root of project directory with content

rvm use ruby-<version>@<gemset> 

I have for instance ruby-1.9.2-p290 installed and I created gemset rails 311 for rail 3.1.1, so content of my .rvmc file is

rvm use ruby-1.9.2-p290@rails311 

Comments

0

first check if rvm is installed system wide or for a particular user. if it is installed for a particular user, you should be using the system ruby when on a root. you can check this by type rvm while on root user

generally rvm is installed for a particular user.

You should update your system ruby if you want to use ruby 1.9.2-p290

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.