Jim Weirich wrote:

> Mark Sparshatt wrote:
>
>> I'm trying to use aeditor with the gem version of the Iterator library 
>
> [...]
>
>> so the problem only manifests when using the gem version of iterator 
>> through the stub file.
>
>
> Mark, I'm trying to understand why the stub file is not working. 
> Unfortunately, I'm unable to duplicate the problem.  

I've tested it on a different machine and it worked, so it does seem to 
be something on this particular machine.

> Do you have any insight on the root cause of the problem?

After investigating this a bit the best I could figure out was that 
modifying $: and $" leaves the system in an unstable state so that any 
further requires cause problems.

I tried this test program

require "requiretest"
require "optparse"

where requiretest.rb contains
$".delete('requiretest.rb')
$:.unshift('lib')
require 'requiretest'

and lib/requiretest.rb contains
puts "test"

this doesn't segfault but it does hang when it reachs the require 
'optparse' line, so that I need to do killall ruby in order to get it to 
exit.

> What version of RubyGems was used to generate the stub?
>
gem -v
=> 0.7.0

This is the stub file

require 'rubygems'
$".delete('iterator.rb')
require_gem 'iterator'

--
Mark Sparshatt