rvm and gem confusion

I've previously used Macports to manage ruby. Now I've installed rvm and installed ruby 1.9.2. Seems to be ok. But I'm a bit confused of where the gems are. So 2 questions:

1) I have my gems in .gem. This is the "old" location. With rvm they should be in .rvm. I've created a gemset global. Will this then be available for all apps on the server?

2) When trying to install mail with "gem install mail" I get "ERROR: While executing gem ... (Errno::EACCES) Permission denied - /Users/me/.gem/specs". Why (besides the permission issue)? Is it still trying to install in .gem?

Paul Bergstrom wrote in post #964914:

I've previously used Macports to manage ruby. Now I've installed rvm and installed ruby 1.9.2. Seems to be ok. But I'm a bit confused of where the gems are. So 2 questions:

1) I have my gems in .gem. This is the "old" location. With rvm they should be in .rvm. I've created a gemset global. Will this then be available for all apps on the server?

2) When trying to install mail with "gem install mail" I get "ERROR: While executing gem ... (Errno::EACCES) Permission denied - /Users/me/.gem/specs". Why (besides the permission issue)? Is it still trying to install in .gem?

This is probably better asked on the Ruby or RVM list. It certainly has nothing to do with Rails.

Best,

You're really a funny guy Marnen. I thought Rails was based on Ruby. :slight_smile:

I'm trying to install Rails 3. Besides this hopeless linear behavior from Marnen, anyone who can assist me with an answer? Or should I ask in the Ruby list instead and say that I'm trying to install Rails using rvm and gem but be asked to jump over to Rails list instead as I happen to mention Rails?

Paul Bergstrom wrote in post #964948:

You're really a funny guy Marnen. I thought Rails was based on Ruby. :slight_smile:

Of course it is. This list, however, is not for basic Ruby or RVM questions, but only for issues specific to Rails. So your question is off topic here. Please take it where it is on topic -- that way it will get seen by more people who can help.

I'm trying to install Rails 3. Besides this hopeless linear behavior from Marnen, anyone who can assist me with an answer? Or should I ask in the Ruby list instead and say that I'm trying to install Rails using rvm and gem but be asked to jump over to Rails list instead as I happen to mention Rails?

Your problem is with RVM, not with Ruby or Rails.

Best,

Maybe your RVM is not running as a function that is causing gem env confusion. Check out the manual, Post Install section.

Run "type rvm | head -n1" and check if the return is "rvm is a function". And if it's not, follow the instructions given in the manual. Hope this helps.

tundrax wrote in post #964969:

Maybe your RVM is not running as a function that is causing gem env confusion. Check out the manual, Post Install section.

Run "type rvm | head -n1" and check if the return is "rvm is a function". And if it's not, follow the instructions given in the manual. Hope this helps.

Thanks. :slight_smile:

Marnen Laibow-Koser wrote in post #964957:

Your problem is with RVM, not with Ruby or Rails.

And what is yours?

Hello,

I'm not sure if I got it well, but I'll try my best. So have you installed RVM already? It's wise to install Ruby 1.9, then set it as default, then install the gem - but not as super user! So without sudo! This way it won't be in your system files, it will be "Ruby- vesrion-specific".

Also it's a good idea, hogy uninstall, reinstall rubygems, since sometimes it's wokring well around updates.

May I ask you to write here the output of theese commands: ruby -v gem -v rvm -v rails -v gem list

and your OS? and which Rails are you using/would you like to use?

I think alost every info is here: http://rvm.beginrescueend.com/

but feel free to ask here, or almost every other mailing list... don't care if others are not really helpful! :wink: cheers, good luck, Zoltán

Zoltan Gero wrote in post #965261:

Hello,

I'm not sure if I got it well, but I'll try my best. So have you installed RVM already? It's wise to install Ruby 1.9, then set it as default, then install the gem - but not as super user! So without sudo! This way it won't be in your system files, it will be "Ruby- vesrion-specific".

Yes. But I had to use sudo as I got an error of some sort and a reference to my previous gem, the .gemrc. Not sure what that was.

Also it's a good idea, hogy uninstall, reinstall rubygems, since sometimes it's wokring well around updates.

Perhaps it's a good idea to uninstall and start over.

May I ask you to write here the output of theese commands: ruby -v

ruby 1.9.2p0 (2010-08-18 revision 29036) [i386-darwin10.5.0]

gem -v

1.3.7

rvm -v

rvm 1.1.1 by Wayne E. Seguin (wayneeseguin@gmail.com) [http://rvm.beginrescueend.com/\]

rails -v

Rails 3.0.3

gem list

abstract (1.0.0) actionmailer (3.0.3) actionpack (3.0.3) activemodel (3.0.3) activerecord (3.0.3) activeresource (3.0.3) activesupport (3.0.3) arel (2.0.4) builder (2.1.2) bundler (1.0.7) daemon_controller (0.2.5) erubis (2.6.6) fastthread (1.0.7) file-tail (1.0.5) i18n (0.5.0) mail (2.2.11) mime-types (1.16) mysql (2.8.1) passenger (3.0.0) polyglot (0.3.1) rack (1.2.1) rack-mount (0.6.13) rack-test (0.5.6) rails (3.0.3) railties (3.0.3) rake (0.8.7) spruz (0.2.2) thor (0.14.6) treetop (1.4.9) tzinfo (0.3.23)

and your OS? and which Rails are you using/would you like to use?

I'm working on Mac OS 10.6.5 locally, using nginx and passenger. Then I have a VPS with Debian 5 where I will host my apps.

I think alost every info is here: http://rvm.beginrescueend.com/

I've seen that. Thanks.

but feel free to ask here, or almost every other mailing list... don't care if others are not really helpful! :wink: cheers, good luck, Zoltn

Thank you very much. Feels really good to read a post like yours. I appreciate your effort to help. :slight_smile:

I've used Rails for a few years now, but I'm not the natural programmer and I can get stuck on technical stuff, even though I feel at home in the Terminal and such. This thing with rvm was new to me, and yes, a bit confusing.

What I don't understand is how my old Rails 2 apps will deal with rvm. Will they use my old gems and run as before even though I've set rvm with 1.9.2 as --default? Well, it looks like they do but I'm not sure which gem is used and where.

Did you install rvm using sudo? If you sudo install it, it'll make it so you have to use sudo to install any gems. If you want to tell which ruby you're running (on a mac) type:

which ruby

shouldn't be /usr/bin/ruby

Chris Lemcke wrote in post #965274:

Did you install rvm using sudo? If you sudo install it, it'll make it so you have to use sudo to install any gems. If you want to tell which ruby you're running (on a mac) type:

I can't remember but I don't think so. I stand as owner for the .rvm directory.

which ruby

shouldn't be /usr/bin/ruby

It's the ruby installed by rvm.

Maybe I should start over. If I uninstall rvm will that mean I get rid of the installed rvm gems as well? I presume so. Can I just delete the .rvm directory?

I recently had to reinstall rvm when I was upgrading from rails 3.0.0 to rails 3.0.3 (maybe too harsh but it worked), so in order to remove the cached gems (on a single user install), I removed all the stuff in $HOME/.rvm/gems

Btw, I don't think you should've used sudo in the first place so maybe just doing a fresh single user install without sudo will help you.

AFAIK, deleting .rvm is the recommended way on rvm's site to delete a single user install.

Martin

Paul Bergstrom wrote in post #965326:

Maybe I should start over. If I uninstall rvm will that mean I get rid of the installed rvm gems as well? I presume so. Can I just delete the .rvm directory?

AFAIK everything related to RVM is stored inside ~/.rvm. I've reinstalled before by simply deleting the directory and reinstalling.

If you want to know details about your RVM environment use...

rvm info

It will tell you where to find the gem folder and exactly what gemset you're using. All of this information can be found in the RVM docs on their web site.

Paul Bergstrom wrote in post #965326:

Maybe I should start over. If I uninstall rvm will that mean I get rid

of the installed rvm gems as well? I presume so. Can I just delete the

.rvm directory?

AFAIK everything related to RVM is stored inside ~/.rvm. I’ve

reinstalled before by simply deleting the directory and reinstalling.

I think this is right… also I would recommend you trying to use gemsets – I have found that making a gemset for each of my apps has been working nicely, and makes them easy to find, i.e.

.rvm/gems/ruby-1.9.2-p0@wavelineup3/gems

Where wavelineup3 is the gemset I created under ruby-1.9.2-p0 installation for one of my apps. See: http://rvm.beginrescueend.com/gemsets/creating/

Robert Walker wrote in post #965446:

Paul Bergstrom wrote in post #965326:

Maybe I should start over. If I uninstall rvm will that mean I get rid of the installed rvm gems as well? I presume so. Can I just delete the .rvm directory?

AFAIK everything related to RVM is stored inside ~/.rvm. I've reinstalled before by simply deleting the directory and reinstalling.

I was able to delete all in my previous location. Now I can start over using rvm.

If you want to know details about your RVM environment use...

rvm info

It will tell you where to find the gem folder and exactly what gemset you're using. All of this information can be found in the RVM docs on their web site.

Thanks. Everything seems to be ok now, kept in rvm.

David Kahn wrote in post #965487:

I think this is right... also I would recommend you trying to use gemsets --

Yes, I've realized that's the way to go. Trying to figure out how to do it. Thanks.

Paul Bergstrom wrote in post #965521:

David Kahn wrote in post #965487:

I think this is right... also I would recommend you trying to use gemsets --

Yes, I've realized that's the way to go. Trying to figure out how to do it. Thanks.

Once you get your gemsets configured look into using .rvmrc files in your projects to automate the switching of your environment.

rvm gemset create my_gemset

rvm use 1.9.2@my_gemset

my_project --> .rvmrc

Robert Walker wrote in post #965531:

Once you get your gemsets configured look into using .rvmrc files in your projects to automate the switching of your environment.

rvm gemset create my_gemset

rvm use 1.9.2@my_gemset

my_project --> .rvmrc ------------------ rvm 1.9.2@my_gemset

http://rvm.beginrescueend.com/workflow/rvmrc/

And don't forget to set your default interpreter:

http://rvm.beginrescueend.com/rubies/default/

Thanks. :slight_smile:

Paul Bergstrom wrote in post #965521:

David Kahn wrote in post #965487:

I think this is right… also I would recommend you trying to use

gemsets –

Yes, I’ve realized that’s the way to go. Trying to figure out how to do

it. Thanks.

Once you get your gemsets configured look into using .rvmrc files in

your projects to automate the switching of your environment.

rvm gemset create my_gemset

rvm use 1.9.2@my_gemset

my_project

→ .rvmrc


rvm 1.9.2@my_gemset

Nice! Then that is my next step… and I am getting tired of typing rvm etc… in every terminal window I open.

Besides rvm and the gem directory there I have a .gemrc in my home directory and a .gem directory. Not sure why I have it there. It stops my installation of Rails 3, complaining about permissions of the .gemrc. Is that something I've created or has it to do with Mac OS Snow Leopard? That is, can I delete them?