3

I'm trying to install Rails using Rubygems via RVM. When running the command gem install rails -v 3.2.0, I receive the error:

ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions into the /usr/share/ruby-rvm/gems/ruby-1.9.3-p0 directory.

I don't want to run it with sudo because RVM's website specifically advises against that. Any thoughts why I may be getting this error and how to get around it?

Details:

  • RVM version 1.10.2
  • Ruby version 1.9.3
  • Ubuntu version 11.10
Andrew Marshall
  • 95,083
  • 20
  • 220
  • 214
Nick
  • 9,493
  • 8
  • 43
  • 66
  • Well, what are the permissions of that directory? Is this on a server? – Andrew Marshall Feb 12 '12 at 06:45
  • Further, why are you explicitly installing any older version of Rails 3.2? Rails 3.2.1 is out with [several bug fixes](https://gist.github.com/1685812). – Andrew Marshall Feb 12 '12 at 06:48
  • 1
    your question is not duplicate but the answer is: http://stackoverflow.com/questions/9056008/installed-ruby-1-9-3-with-rvm-but-command-line-doesnt-show-ruby-v/9056395#9056395 – mpapis Feb 12 '12 at 08:49
  • @Andrew I don't know what the permissions are (sorry, I'm a bit if a Linux noob). It's a local dev environment. And I'm installing 3.2.0 because I thought that is what I saw on the rails site. Must have made a mistake. – Nick Feb 12 '12 at 15:12
  • @mpapis Thanks for the link. I'll give it a shot when I get back on the machine. Just to note, that's the install command I used, so I imagine the important difference is the removal of those two directories when removing rvm. – Nick Feb 12 '12 at 15:14
  • @mpapis I ran the `remove` command but when I run `env | grep rvm`, I get back a number of different rvm settings such as `rvm_bin_path`, `rvm_tar`, `rvm_remove_flag`, `rvm_path`, `rvm_uname`, `rvm_prefix`, `PATH`, `rvm_version`, `rvm_ruby_string`, and `rvm_reload`. Could this be because I hadn't installed using `apt-get` in the first place? – Nick Feb 12 '12 at 18:04

1 Answers1

0

I think the problem is that after installing rvm and ruby you should issue this command

rvm use ruby-1.9.2 --defaults

After that you install rails without any version and don't worry about it

gem install rails

After installing RVM create gemset directory every time whenever you create separate

project. e.g you create application blog. first you create gemset directory with giving

this command and if you want some sepecific version of rails for this application write it

down to gem file

rvm gemset create blog

then you should use this gemset directory and also ruby version as well e.g you have install ruby 1.9.2 then use this command

  rvm use ruby-1.9.2@blog

after that go into directory of blog application and install this gem

  gem install bundler

and also then bundle install. so all local gem will be installed into this blog directory

under rvm and there will be no conflicts will be appear And also check the rails version it

will be according to gemfile.

Kashiftufail
  • 10,815
  • 11
  • 45
  • 79