Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > RubyGems - change location from local?

Reply
Thread Tools

RubyGems - change location from local?

 
 
Adam Wilson
Guest
Posts: n/a
 
      08-28-2009
I am having a problem on my server with gems..

it manifested as it was giving me an error when starting mongrel:

RubyGem version error: rack(0.3.0 not ~> 1.0.0)

I installed and checked using gem list, and it seems to be only showing
those gems installed since I recently upgraded RubyGems.
So, using locate I saw that 0.3.0 is install in /usr/lib and 1.0.0 is
installed in /usr/local/lib .. and I cannot properly uninstall 0.3.0, I
tried deleting the files but I still get the error above. Not wanting to
mess up the gems on my server I am asking here for advice.

Ideally, I would switch RubyGems to use usr/lib as most of my gems are
installed there. I could not find it in the docs, any tips much
appreciated.

Thanks
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Jörg W Mittag
Guest
Posts: n/a
 
      08-28-2009
Adam Wilson wrote:
[...]
> I installed and checked using gem list, and it seems to be only showing
> those gems installed since I recently upgraded RubyGems.

[...]
> Ideally, I would switch RubyGems to use usr/lib as most of my gems are
> installed there. I could not find it in the docs, any tips much
> appreciated.


The environment variable GEM_HOME contains a single directory, which
tells RubyGems where to install new gems and the environment variable
GEM_PATH contains a list of paths where RubyGems looks for gems.

So, in your case you would probably want to set GEM_HOME to /usr/lib,
so that all your newly installed gems end up there, and you would set
GEM_PATH to /usr/lib:/usr/local/lib (not sure about the syntax, is
that colon or semicolon?) so that it finds both.

Alternatively you could set GEM_HOME to /usr/local/lib, gem uninstall
everything, then set to /usr/lib and reinstall. That way you get rid
of the old "ghost" gems there. (Note: there are probably a million
better ways to do this. I know that the RubyGems developers read all
RubyGems related messages, so they'll surely correct me if I'm wrong.)

jwm
 
Reply With Quote
 
 
 
 
Adam Wilson
Guest
Posts: n/a
 
      08-28-2009
Jörg W Mittag wrote:
> Adam Wilson wrote:
> [...]
>> I installed and checked using gem list, and it seems to be only showing
>> those gems installed since I recently upgraded RubyGems.

> [...]
>> Ideally, I would switch RubyGems to use usr/lib as most of my gems are
>> installed there. I could not find it in the docs, any tips much
>> appreciated.

>
> The environment variable GEM_HOME contains a single directory, which
> tells RubyGems where to install new gems and the environment variable
> GEM_PATH contains a list of paths where RubyGems looks for gems.
>
> So, in your case you would probably want to set GEM_HOME to /usr/lib,
> so that all your newly installed gems end up there, and you would set
> GEM_PATH to /usr/lib:/usr/local/lib (not sure about the syntax, is
> that colon or semicolon?) so that it finds both.
>
> Alternatively you could set GEM_HOME to /usr/local/lib, gem uninstall
> everything, then set to /usr/lib and reinstall. That way you get rid
> of the old "ghost" gems there. (Note: there are probably a million
> better ways to do this. I know that the RubyGems developers read all
> RubyGems related messages, so they'll surely correct me if I'm wrong.)
>
> jwm


Many thanks for the info, I will look into it... I will wait till
tomorrow se if any of the RubyGems experts have anything to say, but
that info seems enough at least to help me move forward.

Best,
Adam
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
Eric Hodel
Guest
Posts: n/a
 
      08-28-2009
On Aug 28, 2009, at 05:08, Adam Wilson wrote:

> I am having a problem on my server with gems..
>
> it manifested as it was giving me an error when starting mongrel:
>
> RubyGem version error: rack(0.3.0 not ~> 1.0.0)
>
> I installed and checked using gem list, and it seems to be only
> showing
> those gems installed since I recently upgraded RubyGems.
> So, using locate I saw that 0.3.0 is install in /usr/lib and 1.0.0 is
> installed in /usr/local/lib .. and I cannot properly uninstall
> 0.3.0, I
> tried deleting the files but I still get the error above. Not
> wanting to
> mess up the gems on my server I am asking here for advice.
>
> Ideally, I would switch RubyGems to use usr/lib as most of my gems are
> installed there. I could not find it in the docs, any tips much
> appreciated.


You have two ruby installs. Fix your $PATH to use the ruby and gem
executables from /usr/lib.

`gem env` can help you.

 
Reply With Quote
 
Adam Wilson
Guest
Posts: n/a
 
      08-29-2009
Eric Hodel wrote:
> On Aug 28, 2009, at 05:08, Adam Wilson wrote:
>
>> installed in /usr/local/lib .. and I cannot properly uninstall
>> 0.3.0, I
>> tried deleting the files but I still get the error above. Not
>> wanting to
>> mess up the gems on my server I am asking here for advice.
>>
>> Ideally, I would switch RubyGems to use usr/lib as most of my gems are
>> installed there. I could not find it in the docs, any tips much
>> appreciated.

>
> You have two ruby installs. Fix your $PATH to use the ruby and gem
> executables from /usr/lib.
>
> `gem env` can help you.


Ok, thanks, I did in fact have two Ruby installs... I put /usr/lib at
the front of my path, and that seemed to switch everything to the other
install - which I realised was 1.8.5, I then proceeded to update that
version using the procedure outlined here:
http://snippets.dzone.com/posts/show/5899 (changing --prefix=/usr/local
to --prefix=/usr) which seemed to work great.

I then proceeded to update my RubyGems again... using gem install
rubygems-update followed by update_rubygems.... but now it seems to have
gone back to an old install of 0.9.0, with no gems listed !!? erk..
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
Adam Wilson
Guest
Posts: n/a
 
      08-29-2009
OK Now I see where the problem came from.. I managed to update RubyGems
again, and now I am back to where I started: gem env shows all ruby
paths at /usr/local/bin .. and my $PATH still has /usr/bin as the first
part. This is confusing me now! Is there a way of running the RubyGems
update specifying the path??

Thanks for any help.
Adam.
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
Adam Wilson
Guest
Posts: n/a
 
      08-29-2009
Adam Wilson wrote:
> OK Now I see where the problem came from.. I managed to update RubyGems
> again, and now I am back to where I started: gem env shows all ruby
> paths at /usr/local/bin .. and my $PATH still has /usr/bin as the first
> part. This is confusing me now! Is there a way of running the RubyGems
> update specifying the path??
>
> Thanks for any help.
> Adam.


I also just tried running mongrel_rails ... and I now get this error:

/usr/lib/ruby/1.8/thread.rb:5:in `require': no such file to load --
thread.so (LoadError)

Any help to get me out of this mess much appreciated!

(I think it all started when I was haphazardly trying to upgrade my ruby
in order to run the latest version of Typo for a client, who ended up
not wanted to use it anyway...)
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
Adam Wilson
Guest
Posts: n/a
 
      08-29-2009
OK sorted that problem (copied the file to /usr/bin/ruby/1.

If anyone can help with updating RubyGems but so it uses /usr/bin
instead of /usr/local/bin, that would be much appreciated.

Thank you
Adam
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
Eric Hodel
Guest
Posts: n/a
 
      08-31-2009
On Aug 29, 2009, at 11:35, Adam Wilson wrote:

> OK sorted that problem (copied the file to /usr/bin/ruby/1.


This is probably going to cause a segfault or similar weirdness in the
future. NEVER DO THIS.

> If anyone can help with updating RubyGems but so it uses /usr/bin
> instead of /usr/local/bin, that would be much appreciated.


Uninstall both ruby versions and reinstall from scratch.

 
Reply With Quote
 
Adam Wilson
Guest
Posts: n/a
 
      08-31-2009
Eric Hodel wrote:
> On Aug 29, 2009, at 11:35, Adam Wilson wrote:
>
>> OK sorted that problem (copied the file to /usr/bin/ruby/1.

>
> This is probably going to cause a segfault or similar weirdness in the
> future. NEVER DO THIS.
>
>> If anyone can help with updating RubyGems but so it uses /usr/bin
>> instead of /usr/local/bin, that would be much appreciated.

>
> Uninstall both ruby versions and reinstall from scratch.


OK thanks for the advice... I managed to sort the prob by reinstalling
RubyGems from source specifying /usr/bin/ruby/1.8 as the installation
path and specifiying prefix=/usr .. then ran rubyems_update and it seems
too be working now
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Rubygems 1.3.5 can't load 'rubygems/defaults/operating_sy..' Eric Roscher Ruby 3 11-24-2009 02:15 AM
[OOT] rubygems: location of my gems Nasir Khan Ruby 5 01-04-2008 08:35 PM
Location, location, location =?Utf-8?B?VHJhY2V5?= Wireless Networking 2 02-17-2007 08:37 PM
[BUG] RubyGems: "No such file to load -- rubygems/builder" Erik Veenstra Ruby 4 02-04-2005 10:28 PM
Problems with fresh install of RubyGems on Ubuntu Linux: No suchfile to load -- rubygems/builder (LoadError) Trevor Ruby 5 01-29-2005 12:52 AM



Advertisments