[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

a problem 'require'ing

Simon Schuster

8/8/2007 9:57:00 PM

successfully used gem to install the classifier library but I get this:

irb(main):001:0> require 'classifier'
LoadError: no such file to load -- classifier
from (irb):1:in `require'
from (irb):1:in `Kernel#binding'

maybe the configurations for irb/ruby (doesn't work in 1.8 or 1.9)
aren't aligned with where gem puts the libraries? thanks

7 Answers

Drew Olson

8/8/2007 10:02:00 PM

0

Simon Schuster wrote:
> successfully used gem to install the classifier library but I get this:
>
> irb(main):001:0> require 'classifier'
> LoadError: no such file to load -- classifier
> from (irb):1:in `require'
> from (irb):1:in `Kernel#binding'
>
> maybe the configurations for irb/ruby (doesn't work in 1.8 or 1.9)
> aren't aligned with where gem puts the libraries? thanks

require 'rubygems'
require 'classifier'

--
Posted via http://www.ruby-....

Gordon Thiesfeld

8/8/2007 10:08:00 PM

0

On Aug 8, 4:56 pm, "Simon Schuster" <significa...@gmail.com> wrote:
> successfully used gem to install the classifier library but I get this:
>
> irb(main):001:0> require 'classifier'
> LoadError: no such file to load -- classifier
> from (irb):1:in `require'
> from (irb):1:in `Kernel#binding'
>
> maybe the configurations for irb/ruby (doesn't work in 1.8 or 1.9)
> aren't aligned with where gem puts the libraries? thanks

Did you require rubygems?

>> require 'classifier'
LoadError: no such file to load -- classifier
from (irb):1:in `require'
from (irb):1
>> require 'rubygems'
=> true
>> require 'classifier'
c:0:Warning: require_gem is obsolete. Use gem instead.
Notice: for 10x faster LSI support, please install http://rb-gsl.ruby...
=> true
>>

Gordon

Simon Schuster

8/8/2007 10:16:00 PM

0

I've just noticed that that's probably the problem. but unfortunately,

irb(main):001:0> require 'rubygems'
LoadError: no such file to load -- rubygems


On 8/8/07, Gordon Thiesfeld <gthiesfeld@gmail.com> wrote:
> On Aug 8, 4:56 pm, "Simon Schuster" <significa...@gmail.com> wrote:
> > successfully used gem to install the classifier library but I get this:
> >
> > irb(main):001:0> require 'classifier'
> > LoadError: no such file to load -- classifier
> > from (irb):1:in `require'
> > from (irb):1:in `Kernel#binding'
> >
> > maybe the configurations for irb/ruby (doesn't work in 1.8 or 1.9)
> > aren't aligned with where gem puts the libraries? thanks
>
> Did you require rubygems?
>
> >> require 'classifier'
> LoadError: no such file to load -- classifier
> from (irb):1:in `require'
> from (irb):1
> >> require 'rubygems'
> => true
> >> require 'classifier'
> c:0:Warning: require_gem is obsolete. Use gem instead.
> Notice: for 10x faster LSI support, please install http://rb-gsl.ruby...
> => true
> >>
>
> Gordon
>
>
>

Simon Schuster

8/9/2007 1:13:00 AM

0

an update: I CAN require 'rubygems' if I start irb from the
/usr/lib/ruby/1.8 directory, which is where I found rubygems.rb ...
there's also this:

irb(main):003:0> $:
=> ["/usr/local/lib/site_ruby/1.9",
"/usr/local/lib/site_ruby/1.9/i486-linux",
"/usr/local/lib/site_ruby/1.9/i386-linux", "/usr/local/lib/site_ruby",
"/usr/lib/ruby/1.9", "/usr/lib/ruby/1.9/i486-linux",
"/usr/lib/ruby/1.9/i386-linux", "."]

the "." being the only reason it found rubygems this time. so, that
being the problem, I'm having a bit of a problem finding how can I
change/add paths for irb/ruby/wherever that's configured.

thanks!

On 8/8/07, Simon Schuster <significants@gmail.com> wrote:
> I've just noticed that that's probably the problem. but unfortunately,
>
> irb(main):001:0> require 'rubygems'
> LoadError: no such file to load -- rubygems
>
>
> On 8/8/07, Gordon Thiesfeld <gthiesfeld@gmail.com> wrote:
> > On Aug 8, 4:56 pm, "Simon Schuster" <significa...@gmail.com> wrote:
> > > successfully used gem to install the classifier library but I get this:
> > >
> > > irb(main):001:0> require 'classifier'
> > > LoadError: no such file to load -- classifier
> > > from (irb):1:in `require'
> > > from (irb):1:in `Kernel#binding'
> > >
> > > maybe the configurations for irb/ruby (doesn't work in 1.8 or 1.9)
> > > aren't aligned with where gem puts the libraries? thanks
> >
> > Did you require rubygems?
> >
> > >> require 'classifier'
> > LoadError: no such file to load -- classifier
> > from (irb):1:in `require'
> > from (irb):1
> > >> require 'rubygems'
> > => true
> > >> require 'classifier'
> > c:0:Warning: require_gem is obsolete. Use gem instead.
> > Notice: for 10x faster LSI support, please install http://rb-gsl.ruby...
> > => true
> > >>
> >
> > Gordon
> >
> >
> >
>
>

Eric Hodel

8/9/2007 2:13:00 AM

0

On Aug 8, 2007, at 18:13, Simon Schuster wrote:

> an update: I CAN require 'rubygems' if I start irb from the
> /usr/lib/ruby/1.8 directory, which is where I found rubygems.rb ...
> there's also this:
>
> irb(main):003:0> $:
> => ["/usr/local/lib/site_ruby/1.9",
> "/usr/local/lib/site_ruby/1.9/i486-linux",
> "/usr/local/lib/site_ruby/1.9/i386-linux", "/usr/local/lib/site_ruby",
> "/usr/lib/ruby/1.9", "/usr/lib/ruby/1.9/i486-linux",
> "/usr/lib/ruby/1.9/i386-linux", "."]
>
> the "." being the only reason it found rubygems this time. so, that
> being the problem, I'm having a bit of a problem finding how can I
> change/add paths for irb/ruby/wherever that's configured.

You need to install rubygems for ruby 1.9 as well as 1.8.

--
Poor workers blame their tools. Good workers build better tools. The
best workers get their tools to do the work for them. -- Syndicate Wars



Simon Schuster

8/9/2007 6:04:00 AM

0

could I also maybe stick to 1.8 ? I don't know if I really need 1.9
for anything and it's just mucking up some stuff. maybe it's not
useful to have both installed, and maybe it's downright ill-advised?

On 8/8/07, Eric Hodel <drbrain@segment7.net> wrote:
> On Aug 8, 2007, at 18:13, Simon Schuster wrote:
>
> > an update: I CAN require 'rubygems' if I start irb from the
> > /usr/lib/ruby/1.8 directory, which is where I found rubygems.rb ...
> > there's also this:
> >
> > irb(main):003:0> $:
> > => ["/usr/local/lib/site_ruby/1.9",
> > "/usr/local/lib/site_ruby/1.9/i486-linux",
> > "/usr/local/lib/site_ruby/1.9/i386-linux", "/usr/local/lib/site_ruby",
> > "/usr/lib/ruby/1.9", "/usr/lib/ruby/1.9/i486-linux",
> > "/usr/lib/ruby/1.9/i386-linux", "."]
> >
> > the "." being the only reason it found rubygems this time. so, that
> > being the problem, I'm having a bit of a problem finding how can I
> > change/add paths for irb/ruby/wherever that's configured.
>
> You need to install rubygems for ruby 1.9 as well as 1.8.
>
> --
> Poor workers blame their tools. Good workers build better tools. The
> best workers get their tools to do the work for them. -- Syndicate Wars
>
>
>
>

Eric Hodel

8/9/2007 7:42:00 AM

0

On Aug 8, 2007, at 23:04, Simon Schuster wrote:
> On 8/8/07, Eric Hodel <drbrain@segment7.net> wrote:
>> On Aug 8, 2007, at 18:13, Simon Schuster wrote:
>>
>>> an update: I CAN require 'rubygems' if I start irb from the
>>> /usr/lib/ruby/1.8 directory, which is where I found rubygems.rb ...
>>> there's also this:
>>>
>>> irb(main):003:0> $:
>>> => ["/usr/local/lib/site_ruby/1.9",
>>> "/usr/local/lib/site_ruby/1.9/i486-linux",
>>> "/usr/local/lib/site_ruby/1.9/i386-linux", "/usr/local/lib/
>>> site_ruby",
>>> "/usr/lib/ruby/1.9", "/usr/lib/ruby/1.9/i486-linux",
>>> "/usr/lib/ruby/1.9/i386-linux", "."]
>>>
>>> the "." being the only reason it found rubygems this time. so, that
>>> being the problem, I'm having a bit of a problem finding how can I
>>> change/add paths for irb/ruby/wherever that's configured.
>>
>> You need to install rubygems for ruby 1.9 as well as 1.8.
>
> could I also maybe stick to 1.8 ? I don't know if I really need 1.9
> for anything and it's just mucking up some stuff. maybe it's not
> useful to have both installed, and maybe it's downright ill-advised?

I have both ruby 1.8.x and ruby 1.9.x installed, but with separate
binaries. To do that, use the --program-suffix option to configure:

$ cd /path/to/ruby/source
$ ./configure --program-suffix=19
$ make && sudo make install

To run ruby 1.9.x use "ruby19". My ruby 1.8.x is installed as
"ruby186" with a symlink to "ruby"

PS: You can use the GEM_PATH environment variable to make ruby 1.9.x
pick up ruby 1.8.x gems, but you still need to have RubyGems
installed twice (not entirely true, but its the easiest way to go).

PPS: By the end of October, RubyGems will come included with ruby 1.9.x.

--
Poor workers blame their tools. Good workers build better tools. The
best workers get their tools to do the work for them. -- Syndicate Wars