a problem 'require'ing

S

Simon Schuster

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
 
D

Drew Olson

Simon said:
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'
 
G

Gordon Thiesfeld

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?
LoadError: no such file to load -- classifier
from (irb):1:in `require'
from (irb):1c:0:Warning: require_gem is obsolete. Use gem instead.
Notice: for 10x faster LSI support, please install http://rb-gsl.rubyforge.org/
=> true
Gordon
 
S

Simon Schuster

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
 
S

Simon Schuster

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!
 
E

Eric Hodel

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.
 
S

Simon Schuster

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?

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.
 
E

Eric Hodel

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.
 

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,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top