rubygems
is 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'
from (irb):1
'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
-rubygems
flag into your RUBYOPT
environment 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
RUBYOPT
first before overwriting it though!
1 comments:
> That unhelpful message actually implies that you're missing rubygems as a requirement.
That could be the case, but I don't think that's the only reason this error might happen.
Post a Comment