What am I doing wrong?

Discussion in 'Ruby' started by Mark J. Reed, Aug 11, 2005.

  1. Mark J. Reed

    Mark J. Reed Guest

    After installing pathname2 on my Windows box went so well, I decided to
    go ahead and install it elsewhere for consistency, and it universally failed.
    On the same Windows box under Cygwin, on Linux, on Mac OS X, I got the same
    result. The gem installation appeared to succeed but Ruby couldn't find
    the newly-installed module file. Any help?

    $ sudo gem install pathname2
    Password:
    Attempting local installation of 'pathname2'
    Local gem file not found: pathname2*.gem
    Attempting remote installation of 'pathname2'
    Updating Gem source index for: http://gems.rubyforge.org
    Install required dependency facade? [Yn] y
    Successfully installed pathname2-1.1.0
    Successfully installed facade-1.0.1
    Installing RDoc documentation for pathname2-1.1.0...
    Installing RDoc documentation for facade-1.0.1...
    $ irb -r pathname2
    /usr/lib/ruby/1.8/irb/init.rb:215:in `require': No such file to load -- pathname2 (LoadError)
    from /usr/lib/ruby/1.8/irb/init.rb:215:in `load_modules'
    from /usr/lib/ruby/1.8/irb/init.rb:213:in `each'
    from /usr/lib/ruby/1.8/irb/init.rb:213:in `load_modules'
    from /usr/lib/ruby/1.8/irb/init.rb:21:in `setup'
    from /usr/lib/ruby/1.8/irb.rb:54:in `start'
    from /usr/bin/irb:13
    $
     
    Mark J. Reed, Aug 11, 2005
    #1
    1. Advertising

  2. On 8/11/05, Mark J. Reed <> wrote:
    > After installing pathname2 on my Windows box went so well, I decided to
    > go ahead and install it elsewhere for consistency, and it universally fai=

    led.
    > On the same Windows box under Cygwin, on Linux, on Mac OS X, I got the sa=

    me
    > result. The gem installation appeared to succeed but Ruby couldn't find
    > the newly-installed module file. Any help?
    >=20
    > $ sudo gem install pathname2
    > Password:
    > Attempting local installation of 'pathname2'
    > Local gem file not found: pathname2*.gem
    > Attempting remote installation of 'pathname2'
    > Updating Gem source index for: http://gems.rubyforge.org
    > Install required dependency facade? [Yn] y
    > Successfully installed pathname2-1.1.0
    > Successfully installed facade-1.0.1
    > Installing RDoc documentation for pathname2-1.1.0...
    > Installing RDoc documentation for facade-1.0.1...
    > $ irb -r pathname2
    > /usr/lib/ruby/1.8/irb/init.rb:215:in `require': No such file to load -- p=

    athname2 (LoadError)
    > from /usr/lib/ruby/1.8/irb/init.rb:215:in `load_modules'
    > from /usr/lib/ruby/1.8/irb/init.rb:213:in `each'
    > from /usr/lib/ruby/1.8/irb/init.rb:213:in `load_modules'
    > from /usr/lib/ruby/1.8/irb/init.rb:21:in `setup'
    > from /usr/lib/ruby/1.8/irb.rb:54:in `start'
    > from /usr/bin/irb:13
    > $
    >=20
    >=20



    try this:

    irb -r rubygems -r pathname2
     
    Jason Foreman, Aug 11, 2005
    #2
    1. Advertising

  3. Mark J. Reed

    Jim Weirich Guest

    On Thursday 11 August 2005 04:21 pm, Mark J.Reed wrote:
    > Jason Foreman <> writes:
    > >try this:
    > >
    > >irb -r rubygems -r pathname2

    >
    > Thanks, that worked . . . as does using "-r ubygems", which is a nice
    > "nroff -man"ish touch. And I see that the reason it worked on Windows is
    > that it adds "-rubygems" to $RUBYOPT, and children's mods to the
    > environment affect their parents in Windows, unlike in the Unixy world.
    >
    > Is $RUBYOPT the best way to set things up so that rubygems is always
    > "prequire"d?


    If you consistently use rubygems and can control your own environment, it is
    probably the easiest choice.

    See http://docs.rubygems.org/read/chapter/3#page70 for your list of options.

    --
    -- Jim Weirich http://onestepback.org
    -----------------------------------------------------------------
    "Beware of bugs in the above code; I have only proved it correct,
    not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)
     
    Jim Weirich, Aug 12, 2005
    #3
  4. Mark J. Reed

    Jim Weirich Guest

    Mark J.Reed said:
    > Which seem to boil down to "set RUBYOPT". Except that doesn't work
    > for gems which are themselves specified via -r. An explict
    > "ruby -rubygems -rsomeGem" works, but with RUBYOPT set to "-rubygems",
    > "ruby -rsomeGem" doesn't; I guess $RUBYOPT gets appended instead of
    > prepended and you wind up with the moral equivalent of
    > "ruby -rsomeGem -rubygems". So it's still not a complete solution.


    My understanding is that -r does not honor the override of the require
    command.

    --=20
    -- Jim Weirich http://onestepback.org
    -----------------------------------------------------------------
    "Beware of bugs in the above code; I have only proved it correct,
    not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)
     
    Jim Weirich, Aug 12, 2005
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Salisha Khan
    Replies:
    1
    Views:
    11,696
    JohnFol
    Aug 1, 2003
  2. Keith R. Williams

    What am I doing wrong?

    Keith R. Williams, Jul 14, 2003, in forum: VHDL
    Replies:
    4
    Views:
    1,064
    Ed Diego
    Jul 15, 2003
  3. ed
    Replies:
    1
    Views:
    672
  4. Aaron Ackerman
    Replies:
    2
    Views:
    392
    Lewis Wang [MSFT]
    Jul 29, 2003
  5. J

    What am I doing wrong

    J, Aug 14, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    409
    John Saunders
    Aug 14, 2003
Loading...

Share This Page