tag:help.rubygems.org,2010-01-19:/discussions/problems/1448-problem-running-rubygems-from-user-directoryRubyGems.org: Discussion 2012-12-19T01:28:56Ztag:help.rubygems.org,2010-01-19:Comment/218197052012-12-01T00:47:47Z2012-12-01T00:47:50Zproblem running RubyGems from user directory<div><p>I installed RubyGems in a user directory on a shared server in
accordance with the instructions here<br>
<a href=
"http://docs.rubygems.org/read/chapter/3">http://docs.rubygems.org/read/chapter/3</a></p>
<p>but the system still wants to use the older/shared version of
RubyGems. If I run "gem -v" I get "1.3.7" back, when the version I
installed is 1.8.24. Seems like the needed directories are not in
the path, so I guess my question is what directories/files need to
by in the path in order for the version of RubyGems that I
installed to take precedence over the old/shared one on the server?
The directory with the "gem18" is in the path, as is the directory
with the "rubygems-1.8.24" directory in it.</p>
<p>Thanks for any help you can offer.</p></div>Dougtag:help.rubygems.org,2010-01-19:Comment/218197052012-12-01T00:51:52Z2012-12-01T00:51:52Zproblem running RubyGems from user directory<div><p>If you have other versions of ruby installed you must
<code>export RUBYLIB=~/prefix/lib</code> or <code>export
RUBYOPT=-I~/profix/lib</code> to place your ruby in the front of
the load path.</p>
<p>Typically, installing rvm is easier.</p></div>Eric Hodeltag:help.rubygems.org,2010-01-19:Comment/218197052012-12-01T01:17:09Z2012-12-01T01:17:09Zproblem running RubyGems from user directory<div><p>Thanks. There's only one version of Ruby installed here (the one
shared<br>
by other users of the shared machine), so what I'm trying to
accomplish<br>
is to still use that version of Ruby, but have it use the version
of<br>
RubyGems that I've installed in my user directory instead of the
older<br>
version of RubyGems that's in with the shared version of Ruby.
Maybe<br>
what I'm trying to do isn't possible?</p></div>Doug Quirketag:help.rubygems.org,2010-01-19:Comment/218197052012-12-01T01:41:16Z2012-12-01T01:41:16Zproblem running RubyGems from user directory<div><p>It's perfectly possible, just use <code>RUBYLIB</code> or
<code>RUBYOPT</code> as described in my previous post. This is how
we test new versions of RubyGems as we are developing them while
still using a stable version for our other work.</p></div>Eric Hodeltag:help.rubygems.org,2010-01-19:Comment/218197052012-12-01T19:09:40Z2012-12-01T19:09:40Zproblem running RubyGems from user directory<div><p>Got it. Thanks so much, that did the trick!</p></div>Doug Quirke