From: Antonio Terceiro Date: 2011-08-13T02:54:40+09:00 Subject: Re: Ruby - debian sid - cannot load gems - irb works --vEao7xgI/oilGqZ+ Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Freak On A Leash escreveu isso a=ED: > ruby --debug parseini.rb > Exception `LoadError' at /usr/lib/ruby/vendor_ruby/1.8/rubygems.rb:1340 > - no such file to load -- rubygems/defaults/operating_system > Initializing script > Exception `LoadError' at > /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36 - no such > file to load -- ini > # This is not an error. You passed --debug to ruby and that makes Ruby to print all exceptions that happen to the console. When you do `require "ini"`, The new `require` provided by first tries to load from the current $LOAD_PATH, and that raises a LoadError because `ini` is not installed system wide. Rubygems handles that exception, activates the gem (what adds the gem's lib/ directory to the $LOAD_PATH), and then tries `require 'ini'` again. And it works: if you notice the end of the output, your script wrote the Ini object to the standard output. --=20 Antonio Terceiro http://softwarelivre.org/terceiro --vEao7xgI/oilGqZ+ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEARECAAYFAk5FaE4ACgkQDOM8kQ+cso9PBQCeM9Lv2+C6QhHRYQ9fw4+xYpJ5 48MAoIw9n5kCY6e1bdjccG6zUgL+0Exy =esJz -----END PGP SIGNATURE----- --vEao7xgI/oilGqZ+--