Question about -r command line option, rubygems

D

Daniel Berger

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:
C:\ruby -rubygems -rturn test.rb
ruby: no such file to load -- turn (LoadError)

But, I clearly have it installed:
C:\>ruby -e "require 'turn'"
Loaded suite .
==============================================================================
pass: 0, fail: 0, error: 0
total: 0 tests with 0 assertions in 0.0 seconds
==============================================================================

What am I doing wrong?

Regards,

Dan
 
D

David Vallner

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

Daniel said:
Hi all,
=20
Ruby 1.8.5 (one click)
Windows XP
=20
I'm trying to require a gem from the command line but it's failing:
=20
ruby: no such file to load -- turn (LoadError)
=20
But, I clearly have it installed:
=20
Loaded suite .
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
=20
pass: 0, fail: 0, error: 0
total: 0 tests with 0 assertions in 0.0 seconds
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
=20

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

David Vallner


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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (MingW32)

iD8DBQFFXmA2y6MhrS8astoRAlmxAJ9CbuyjAMaaPVx/hbxcrE2svvx5vQCeNHqu
j/Ljqci6emWeQRQRsE3dLlg=
=1fr1
-----END PGP SIGNATURE-----

--------------enigD7007A594786A0004ADACD3D--
 
C

Chad Fowler

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?

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
 
D

Daniel Berger

Chad Fowler wrote:

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.

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

- Dan
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top