rubygems install problems (the old ubygems (LoadError) problem. Sigh).

P

Paul van Delst

Hello,

I just did a complete re-install of ruby 1.8.5-p12 and rubygems-0.9.0 and I'm getting the
old sawhorse error:

ruby: no such file to load -- ubygems (LoadError)

I've searched the newsgroup, but nothing seems to address the problem I'm having (I
think). Here's what I did:

0) rm -fr'd my "ruby" and "rubygems" installation directories in my $HOME/local (I do not
have root access to the computer in question). Also unset RUBYOPT.

ruby install
------------
1) Installed ruby 1.8.5-p12. No problems
2) Modified my login script with:
export PATH=$PATH:${HOME}/local/ruby/bin
ruby and irb run fine.

rubygems install
----------------
3) Specified where I want gems to actually go,
export GEM_HOME=${HOME}/local/rubygemrepository
4) ruby setup.rb config --prefix=${HOME}/local/rubygems
5) ruby setup.rb setup
6) ruby setup.rb install
....
Successfully built RubyGem
Name: sources
Version: 0.0.1
File: sources-0.0.1.gem
7) In login script added
export GEM_HOME=${HOME}/local/rubygemrepository
export PATH=$PATH:${HOME}/local/rubygems/bin
and
export RUBYOPT="rubygems"


Now I want to install a gem (Bil Kleb's funit) and I did:

gem install funit

and got the error:

ruby: no such file to load -- ubygems (LoadError)

And, of course, ruby and irb no longer work either (same error).

O.k., so what did I do wrong? *After* I installed rubygems I set the RUBYOPT envar. But,
ruby can't seem to find anything rubygem related.

Is there some other magical envar that I need to set so that ruby and rubygems play nice?

Or should I install rubygem "inside" my ruby install? In:
${HOME}/local/ruby/lib/ruby/site_ruby/1.8/i686-linux ?
or
${HOME}/local/ruby/lib/ruby/site_ruby
or
??

I followed the notes I made last time I did this[*] and it worked then, so I've screwed
something up somewhere; I just don't know what.

Any help/info appreciated.

cheers,

paulv


[*] Said notes being a little sketchy, hence my starting from scratch effort.
 
E

Eric Hodel

I just did a complete re-install of ruby 1.8.5-p12 and
rubygems-0.9.0 and I'm getting the old sawhorse error:

ruby: no such file to load -- ubygems (LoadError)

I've searched the newsgroup, but nothing seems to address the
problem I'm having (I think). Here's what I did:

0) rm -fr'd my "ruby" and "rubygems" installation directories in my
$HOME/local (I do not have root access to the computer in
question). Also unset RUBYOPT.

ruby install
------------
1) Installed ruby 1.8.5-p12. No problems
2) Modified my login script with:
export PATH=$PATH:${HOME}/local/ruby/bin
ruby and irb run fine.

rubygems install

This tells ruby to put ubygems.rb under ~/local/rubygems.
5) ruby setup.rb setup
6) ruby setup.rb install
....
Successfully built RubyGem
Name: sources
Version: 0.0.1
File: sources-0.0.1.gem

This puts ubygems.rb under ~/local/rubygems.
7) In login script added
export GEM_HOME=${HOME}/local/rubygemrepository
export PATH=$PATH:${HOME}/local/rubygems/bin
and
export RUBYOPT="rubygems"


Now I want to install a gem (Bil Kleb's funit) and I did:

gem install funit

and got the error:

ruby: no such file to load -- ubygems (LoadError)

And, of course, ruby and irb no longer work either (same error).

ubygems.rb is not in your $LOAD_PATH for ruby.
O.k., so what did I do wrong? *After* I installed rubygems I set
the RUBYOPT envar. But, ruby can't seem to find anything rubygem
related.

Is there some other magical envar that I need to set so that ruby
and rubygems play nice?

You probably want to add:

export RUBYLIB=${HOME}/local/rubygems
Or should I install rubygem "inside" my ruby install? In:
${HOME}/local/ruby/lib/ruby/site_ruby/1.8/i686-linux ?
or
${HOME}/local/ruby/lib/ruby/site_ruby
or
??

This is how rubygems is typically installed (by not supplying the --
prefix option in step 4). But you do not have root access. You just
needed to add rubygems to the $LOAD_PATH.
I followed the notes I made last time I did this[*] and it worked
then, so I've screwed something up somewhere; I just don't know what.
 
E

Eric Hodel

You probably want to add:

export RUBYLIB=${HOME}/local/rubygems

Actually, from testing, it'll be more like ${HOME}/local/rubygems/lib/
ruby/site_ruby/1.8 or some-such.
 
P

Paul van Delst

Hi Eric,

Eric said:
This tells ruby to put ubygems.rb under ~/local/rubygems.


This puts ubygems.rb under ~/local/rubygems.


ubygems.rb is not in your $LOAD_PATH for ruby.


You probably want to add:

export RUBYLIB=${HOME}/local/rubygems

Well, I eventually figured out that I need
export RUBYLIB=${HOME}/local/rubygems/lib/ruby/site_ruby/1.8

Just specifying ${HOME}/local/rubygems didn't work.
This is how rubygems is typically installed (by not supplying the
--prefix option in step 4). But you do not have root access. You just
needed to add rubygems to the $LOAD_PATH.

This is going to make your eyes roll, but how does one add a root subdirectory to
LOAD_PATH so that ruby searches recursively down? The only way I can figure out how to
modify LOAD_PATH is to list every specific directory via the RUBYLIB envar -- which is
rather onerous.

An online search didn't reveal anything clever.

cheers,

paulv
 
P

Paul van Delst

Hello again,

O.k., I removed my old rubygems install and did it again but without the --prefix-dir and
everything is now honky dory.

From the rubygems user manual installation help, I assumed that a "default" install would
always go to /usr/lib/ruby/etc.... But it doesn't - it gets installed wherever ruby was
installed (at least, that's what happened on my box).

Thanks for your patience.

cheers,

paulv
 
E

Eric Hodel

Hello again,

O.k., I removed my old rubygems install and did it again but
without the --prefix-dir and everything is now honky dory.

From the rubygems user manual installation help, I assumed that a
"default" install would always go to /usr/lib/ruby/etc.... But it
doesn't - it gets installed wherever ruby was installed (at least,
that's what happened on my box).

Yes, this is correct.

I thought you were installing rubygems using the default (/usr/lib/
ruby) installation, not your own.
 
E

Eric Hodel

This is going to make your eyes roll, but how does one add a root
subdirectory to LOAD_PATH so that ruby searches recursively down?
The only way I can figure out how to modify LOAD_PATH is to list
every specific directory via the RUBYLIB envar -- which is rather
onerous.

An online search didn't reveal anything clever.

You can't, and you don't really want this.

If you have lib/net/http.rb and recursively add everything you'll end
up with the ability to require 'http' which may cause bad things to
happen like double loading.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top