A problem 'require'ing

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:inKernel#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

Simon S. 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:inKernel#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’

On Aug 8, 4:56 pm, “Simon S.” [email protected] 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.rubyforge.org/
=> true

Gordon

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

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!

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 Aug 8, 2007, at 18:13, Simon S. wrote:

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.

On Aug 8, 2007, at 23:04, Simon S. wrote:

“/usr/local/lib/site_ruby/1.9/i386-linux”, "/usr/local/lib/
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.