Wybo Dekker <wybo / servalys.nl> writes:

> Lloyd Zusman wrote:
>> Prior to this, I had earlier problems with gems, and so I completely
>> uninstalled ruby (I had been using the 1.9.x version from cvs), and I
>> re-installed it from the official 1.8.2 version, totally from scratch with
>> none of my old libraries, scripts, or gems present on my system.  It
>> was only then that I installed "gem", and then "rio".
>
> I, too, have the problem and had ruby-1.9 before.

I found a work-around for this problem, but I don't understand why it
fixes it, and why the module wasn't functioning properly in the first
place.

After looking this over, do any of you have any idea why this was
failing, and why this fix worked?

As you can see from the stack trace at the bottom of this message, which
both Wybo and I were getting, the "ExistOrNot" module was not found.
However, moving the following code fragment closer to the top of the
following file seems to fix the problem.

The file:

      .../gems/rio-0.3.4/lib/rio/ops/either.rb

The code fragment:

      module ExistOrNot
      end
      module Existing
        include ExistOrNot
      end
      module NonExisting
        include ExistOrNot
      end

Here's my patch which fixes this:

*** either.rb.orig	Sat Sep 10 09:13:51 2005
--- either.rb	Sat Sep 10 09:15:11 2005
***************
*** 54,57 ****
--- 54,67 ----
    module Ops
      module FileOrDir
+ 
+       module ExistOrNot
+       end
+       module Existing
+         include ExistOrNot
+       end
+       module NonExisting
+         include ExistOrNot
+       end
+ 
        module Existing
          def chmod(mod) rtn_self { Impl::U.chmod(mod,fspath) } end
***************
*** 117,129 ****
  
        end
- 
-       module ExistOrNot
-       end
-       module Existing
-         include ExistOrNot
-       end
-       module NonExisting
-         include ExistOrNot
-       end
      end
    end
--- 127,130 ----


Wybo Dekker <wybo / servalys.nl> writes:

> My test program:
>
> [ ... etc. ... ]
>
> wybo>cat riotest
> #!/usr/bin/env ruby
>
> require 'rio'
> $VERBOSE = true
>
> rio('/etc/passwd') > rio('/tmp/passwd')
> wybo>riotest
> /usr/local/lib/ruby/gems/1.8/gems/rio-0.3.4/lib/rio/cp.rb:190: warning: useless use of < in void context
> /usr/local/lib/ruby/gems/1.8/gems/rio-0.3.4/lib/rio/cp.rb:290: warning: useless use of > in void context
> /usr/local/lib/ruby/gems/1.8/gems/rio-0.3.4/lib/rio/ops/file.rb:62: uninitialized constant RIO::Ops::FileOrDir::ExistOrNot (NameError)
>         from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require__'
>         from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require'
>         from /usr/local/lib/ruby/gems/1.8/gems/rio-0.3.4/lib/rio/file.rb:39
>         from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require__'
>         from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require'
>         from /usr/local/lib/ruby/gems/1.8/gems/rio-0.3.4/lib/rio/factory.rb:197:in `state2class'
>         from /usr/local/lib/ruby/gems/1.8/gems/rio-0.3.4/lib/rio/factory.rb:206:in `try_state_proc'
>         from /usr/local/lib/ruby/gems/1.8/gems/rio-0.3.4/lib/rio/factory.rb:204:in `[]'
>         from /usr/local/lib/ruby/gems/1.8/gems/rio-0.3.4/lib/rio/state.rb:120:in `become'
>         from /usr/local/lib/ruby/gems/1.8/gems/rio-0.3.4/lib/rio/path.rb:80:in `efile'
>         from /usr/local/lib/ruby/gems/1.8/gems/rio-0.3.4/lib/rio/path.rb:65:in `when_missing'
>         from /usr/local/lib/ruby/gems/1.8/gems/rio-0.3.4/lib/rio/state.rb:134:in `method_missing'
>         from /usr/local/lib/ruby/gems/1.8/gems/rio-0.3.4/lib/rio/state.rb:136:in `__send__'
>         from /usr/local/lib/ruby/gems/1.8/gems/rio-0.3.4/lib/rio/state.rb:136:in `method_missing'
>         from /usr/local/lib/ruby/gems/1.8/gems/rio-0.3.4/lib/rio/if/grande.rb:402:in `>'
>         from ./riotest:6
>
> [ ... ]

-- 
 Lloyd Zusman
 ljz / asfast.com
 God bless you.