rubygemsis a great way of installing your packages without having yourself to dirty your hands, but if you installed your gems this way, it however does not mean that loading those newly installed gems is automatically.
It took me a while before I understood why my newly installed gems cannot be loaded through the 'require' statement, and giving me irksome messages like the 'no such file to load' error:
LoadError: no such file to load -- sequelThat unhelpful message actually implies that you're missing rubygems as a requirement. So make sure you load rubygems via
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
'require'before you load any other gems installed by it in your source file:
require 'rubygems'The other way of permanently including rubygems is to export the
# put all other requirements after this
-rubygemsflag into your
RUBYOPTenvironment variable. Different shells may vary, but here's how you'll do it in bash:
% export RUBYOPT=-rubygemsDo make sure you check if there are any existing flags in
RUBYOPTfirst before overwriting it though!