From: Phillip Gawlowski Date: 2011-01-22T00:19:26+09:00 Subject: Re: using gems installed via 'sudo gem install' On Fri, Jan 21, 2011 at 3:29 PM, Piotr S. wrote: > I've installed ruby-opengl through sudo gem install because there were > errors otherwise and now I can't use it with 'ruby main.rb'. When I > typed 'sudo ruby main.rb' I think it worked but there were errors > considering hashes as they're changed in latest version of ruby (I think > I have different ruby versions as I'm also using RVM). Well, if you didn't do a "sudo rvm gem install" (or whatever the syntax is RVM uses to install gems), then your installed gem lands in the system-wide gem repository, which isn't accessible if you switch Ruby versions via rvm. > I know it's confusing but is there a way to somehow transfer gem from > root to rvm or maybe a way to access roots gems without sudo triggering > wrong version of ruby? Create a gemset: http://rvm.beginrescueend.com/gemsets/ That seems to be the easiest way (unless you can install gems via RVM itself; pik can do that for us Windows users, so I doubt RVM can't do that). RVM's documentation should also reveal a means to sync gems across different Ruby versions managed by RVM. -- Phillip Gawlowski Though the folk I have met, (Ah, how soon!) they forget When I've moved on to some other place, There may be one or two, When I've played and passed through, Who'll remember my song or my face.