From: Jeremy Bopp Date: 2010-11-01T13:16:00+09:00 Subject: Re: gems install failed On 10/31/2010 10:13 PM, wroxdb wrote: > Sorry I have got it installed correctly. > Coz I shall install ruby1.8-dev firstly. > > But another question: > > irb(main):003:0* require 'rubygems' > => true > irb(main):004:0> require 'cassandra' > => true > > what's the purpose of require 'rubygems'? > I found that if I didn't require rubygems then require cassandra will get fail. In the version of Ruby you're using, the rubygems module is not loaded by default. Without rubygems loaded, the require method does not know how to find your gems when you try to require them. Ruby 1.9 loads rubygems by default, so it's optional to do so there. If you don't want to explicitly require rubygems in your script, you can also set an environment variable named RUBYOPT as follows to cause your version of Ruby to load it automatically: export RUBYOPT=-rubygems Keep in mind that this environment variable would have to be set any time you want to run your script with Ruby 1.8. -Jeremy