Rubygems install confusion - beginner problems


#1

Yesterday I compiled ruby 1.8.7, and have verified that it’s now
resident on my Kubuntu Linux 8.10 OS. All’s well, except that I’m in a
bit of a muddle with rubygems. It appears that something or other
(Philip Gawlowski suggested it might be Amorok) has installed Ruby 1.9
on my OS, and with it rubygems 1.2.0. But I want ruby 1.8.7 and rubygems
1.3.1.

Right now, looking at /usr/local/lib/site_ruby, I see BOTH 1.8 and
1.9.0. Makes sense, I guess.

Yesterday I installed rubygems 1.3.1, and things went awry. Ignoring
that for now, I just redid the installation, and things went better,
indicating that somehow yesterday we had a moment or two of pilot error.
Sigh.

Here’s the first part of the console output for today install of
rubygems v. 1.3.1 -

tomc@tomc-desktop:~/Software archive/Rubygems/rubygems-1.3.1$ sudo ruby
setup.rb
[sudo] password for
tomc:
mkdir -p
/usr/local/lib/site_ruby/1.8
mkdir -p
/usr/bin
mkdir -p /usr/local/lib/site_ruby/1.8/rbconfig

What I have now is this:

tomc@tomc-desktop:~$ which gem
/usr/bin/gem
tomc@tomc-desktop:~$ gem -v
1.2.0
tomc@tomc-desktop:~$ which gem1.8
/usr/bin/gem1.8
tomc@tomc-desktop:~$ gem1.8 -v
1.3.1

When I tried, yesterday, to install the RedCloth gem using “gem
install…”, the install failed. Something about write permissions.
Today, I find that I can install RedCloth just fine, and and just did,
using “gem1.8”.

So…my question: It would appear that ruby 1.9, when it got installed,
by whatever program needed it, also installed rubygems, but not in a way
that I can get to, and in any case it isn’t the latest version, and
finally, it won’t let me use it anyway. I now have ruby 1.8.7, and
rubygems 1.3.1 installed, but I have NO confidence that ruby 1.8.7 will
access rubygems 1.3.1 should something it’s executing need it. I sure
hope I’m making sense here.

How in the world can I get this fixed? I badly need to get some gems
loaded and get to work again with ruby, and I’m close, but can’t close
the deal.

Can someone tell me how to tell ruby 1.8.7 to go to the right rubygems
when it needs to? I’m sure this involves some environment variable, and
I’ll keep looking for this, but someone who know could sure help me by
simply pointing to it.

Thanks very much for any help you can offer.

t.


#2

Tom C. wrote:

Yesterday I installed rubygems 1.3.1, and things went awry. Ignoring
tomc: mkdir -p
1.2.0
So…my question: It would appear that ruby 1.9, when it got

Can someone tell me how to tell ruby 1.8.7 to go to the right rubygems
when it needs to? I’m sure this involves some environment variable,
and I’ll keep looking for this, but someone who know could sure help
me by simply pointing to it.

Thanks very much for any help you can offer.

t.

Well, the response to this is definitely underwhelming. I’ll try to come
up with more interesting problems in the future!

Meanwhile…it occurred to me that perhaps there IS a rubygems that my
ruby 1.8.7 can find, and I just verified that in irb:

irb(main):004:0> require ‘rubygems’
=> true
irb(main):005:0> require ‘RedCloth’
=> true
irb(main):006:0>

I still don’t know which version of rubygems is being accessed, though -
of the two that my system has - 1.2 and 1.3.1. Maybe I can puzzle this
out somehow. Any help would be appreciated…

t.


#3

On Dec 15, 2008, at 09:01 AM, Tom C. wrote:

[sudo] password for
tomc: mkdir -
p /usr/local/lib/site_ruby/
1.8 mkdir -p /usr/
bin
mkdir -p /usr/local/lib/site_ruby/1.8/rbconfig

More important were the last few lines, they’d look something like
(I’m on OS X):

RubyGems installed the following executables:
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/gem

If gem was installed by a previous RubyGems installation, you may
need
to remove it by hand.

Which tells you were RubyGems put the gem command.

What I have now is this:

tomc@tomc-desktop:~$ which gem
/usr/bin/gem
tomc@tomc-desktop:~$ gem -v
1.2.0

gem env is more illuminating:

$ gem env
RubyGems Environment:

  • RUBYGEMS VERSION: 1.3.1.1939
  • RUBY VERSION: 1.8.6 (2008-03-03 patchlevel 114) [universal-
    darwin9.0]
    […]

So…my question: It would appear that ruby 1.9, when it got
installed, by whatever program needed it, also installed rubygems,
but not in a way that I can get to, and in any case it isn’t the
latest version, and finally, it won’t let me use it anyway.

Likely /usr/bin/gem is a symlink to /usr/bin/gem1.9, likewise for ruby
-> ruby1.9. To make things easier for yourself fix the symlinks to
point to your most-commonly used ruby.

I now have ruby 1.8.7, and rubygems 1.3.1 installed, but I have NO
confidence that ruby 1.8.7 will access rubygems 1.3.1 should
something it’s executing need it. I sure hope I’m making sense here.

I have 100% confidence ruby 1.8.7 will access rubygems 1.3.1. Try:

/path/to/ruby1.8.7 -vrubygems -e ‘p Gem::RubyGemsVersion’

Mine says:

$ /usr/bin/ruby -vrubygems -e ‘p Gem::RubyGemsVersion’
ruby 1.8.6 (2008-03-03 patchlevel 114) [universal-darwin9.0]
“1.3.1.1939”

Can someone tell me how to tell ruby 1.8.7 to go to the right
rubygems when it needs to? I’m sure this involves some environment
variable, and I’ll keep looking for this, but someone who know
could sure help me by simply pointing to it.

It always will. Different major versions of Ruby have different
repositories entirely. For 1.9+, minor versions have different
repositories.

though - of the two that my system has - 1.2 and 1.3.1. Maybe I can
puzzle this out somehow. Any help would be appreciated…

There is only one version of RubyGems allowed per Ruby. Compare
gem1.8 env to gem1.9 env, namely GEM PATHS output.


#4

Eric,

Thank you very much for your detailed and thoughtful response. This is
more than I ever hoped for, and is certainly quite helpful. Thank you
for taking the time to address my problems. We all benefit so very much
from you work.

Tom

Eric H. wrote:

1.9.0. Makes sense, I guess.
ruby setup.rb
RubyGems installed the following executables:
/usr/bin/gem

So…my question: It would appear that ruby 1.9, when it got
something it’s executing need it. I sure hope I’m making sense here.

my ruby 1.8.7 can find, and I just verified that in irb:

There is only one version of RubyGems allowed per Ruby. Compare
gem1.8 env to gem1.9 env, namely GEM PATHS output.

Tom C., MS MA, LMHC - Private practice Psychotherapist
Bellingham, Washington, U.S.A: (360) 920-1226
<< removed_email_address@domain.invalid >> (email)
<< TomCloyd.com >> (website)
<< sleightmind.wordpress.com >> (mental health weblog)