Question about -r command line option, rubygems

Discussion in 'Ruby' started by Daniel Berger, Nov 18, 2006.

  1. Hi all,

    Ruby 1.8.5 (one click)
    Windows XP

    I'm trying to require a gem from the command line but it's failing:
    ruby: no such file to load -- turn (LoadError)

    But, I clearly have it installed:
    Loaded suite .
    pass: 0, fail: 0, error: 0
    total: 0 tests with 0 assertions in 0.0 seconds

    What am I doing wrong?


    Daniel Berger, Nov 18, 2006
    1. Advertisements

  2. --------------enigD7007A594786A0004ADACD3D
    Content-Type: text/plain; charset=ISO-8859-1
    Content-Transfer-Encoding: quoted-printable

    -r probably only uses the "vanilla" semantics of require, and only
    interpreted code picks up the hacks^Wimprovements that rubygems makes.

    David Vallner

    Content-Type: application/pgp-signature; name="signature.asc"
    Content-Description: OpenPGP digital signature
    Content-Disposition: attachment; filename="signature.asc"

    Version: GnuPG v1.4.5 (MingW32)

    -----END PGP SIGNATURE-----

    David Vallner, Nov 18, 2006
    1. Advertisements

  3. Daniel Berger

    Chad Fowler Guest

    The problem is that unfortunately the -r option doesn't use the
    hookable require method, but rather the C function that require
    delegates to (which isn't a Ruby method, so it's not overrideable).
    So, you're not doing anything wrong.

    Chad Fowler, Nov 18, 2006
  4. Chad Fowler wrote:

    Hm, could it be altered to use the hookable require method? If so, what
    would be the downside?

    - Dan
    Daniel Berger, Nov 20, 2006
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.