Gem RVM Permission Error

I started trying to set up local rails for development. However, after I installed during use apt-get, I found out about RVM, so I uninstalled the previous one and installed it again from RVM. It seems like I have residual problems. In particular, when I try to install the rails, I get ...

$ gem install rails
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions into the /var/lib/gems/1.9.1 directory.

This already looks like a problem, because I do not want it in the / var / directory, I want it in the user directory. So, I check the following ...

$ gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.11
  - RUBY VERSION: 1.9.3 (2011-10-30 patchlevel 0) [x86_64-linux]
  - INSTALLATION DIRECTORY: /var/lib/gems/1.9.1
  - RUBY EXECUTABLE: /usr/bin/ruby1.9.1
  - EXECUTABLE DIRECTORY: /usr/local/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /var/lib/gems/1.9.1
     - /home/myusername/.gem/ruby/1.9.1
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://rubygems.org/

Like sudo'd:

$ sudo gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.11
  - RUBY VERSION: 1.9.3 (2011-10-30 patchlevel 0) [x86_64-linux]
  - INSTALLATION DIRECTORY: /var/lib/gems/1.9.1
  - RUBY EXECUTABLE: /usr/bin/ruby1.9.1
  - EXECUTABLE DIRECTORY: /usr/local/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /var/lib/gems/1.9.1
     - /home/myusername/.gem/ruby/1.9.1
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://rubygems.org/
The stones seem to live in / var / lib for some reason. This is normal? How can I fix this to set the rails?

EDIT: UPDATE!

, , , /var/lib/gems/ 1.9.91 () /home/myusername/.gem/ruby/1.9.1 ().

, , "gem" /var/lib/gems/ 1.9.1 (bad) /home/myusername/.gem/ruby/1.9.1 (). - ? , ?

+5
1

ruby,

rvm use 1.9.3 --install

, 1.9.3 , !

, Ubuntu, , RVM Ubuntu - ! : fooobar.com/questions/37088/...

+7

All Articles