Parsing error in 1.8.2 Dir.glob

Hello,

After upgrading to ruby-1.8.2 my gem-based rails no longer ran.
It boiled down to the following:

irb(main):014:0>
Dir.glob("{/usr/lib/ruby/gems/1.8/gems/activerecord-1.0.0/lib,.} \
/active_record/vendor/simple.rb{,.rb,.so}").delete_if{|f| \
File.directory?(f)}.size > 0

ArgumentError: string contains null byte
        from (irb):14:in `directory?'
        from (irb):14
        from (irb):14:in `delete_if'
        from (irb):14
irb(main):015:0>

In the ML I've seen someone with this problem who tried to install a gem.
The problem arises from the .rb in simple.rb.

Cheers,

Han Holl

···

from :0

I should have added the following:
#define RUBY_VERSION "1.8.2"
#define RUBY_RELEASE_DATE "2004-11-15"

I see activity in the ChangeLog on dir.c around
November 11, so it's probably in flux at the moment.

Cheers,

Han Holl

···

On Tuesday 16 November 2004 21:35, Han Holl wrote:

Hello,

Thanks, Han! I haven't had time to test the latest 1.8.2 with
RubyGems (or anything else) yet, so I haven't run into this. You
appear to be correct that there is some problem introduced by the
dir.c change.

···

On Wed, 17 Nov 2004 06:47:29 +0900, Han Holl <han.holl@informationslogik.nl> wrote:

On Tuesday 16 November 2004 21:35, Han Holl wrote:
> Hello,
I should have added the following:
#define RUBY_VERSION "1.8.2"
#define RUBY_RELEASE_DATE "2004-11-15"

I see activity in the ChangeLog on dir.c around
November 11, so it's probably in flux at the moment.

Cheers,

Han Holl

--

Chad Fowler
http://chadfowler.com

http://rubygems.rubyforge.org (over 20,000 gems served!)

Do you think it'd be possible to create some list of incompatible
changes between stable/preview releases?

rpa-base pre-0.2.3 was broken by a change in ruby_1_8/HEAD
(lib/ostruct.rb), too.

···

On Wed, Nov 17, 2004 at 09:28:14AM +0900, Chad Fowler wrote:

> I should have added the following:
> #define RUBY_VERSION "1.8.2"
> #define RUBY_RELEASE_DATE "2004-11-15"
>
> I see activity in the ChangeLog on dir.c around
> November 11, so it's probably in flux at the moment.

Thanks, Han! I haven't had time to test the latest 1.8.2 with
RubyGems (or anything else) yet, so I haven't run into this. You
appear to be correct that there is some problem introduced by the
dir.c change.

--
Hassle-free packages for Ruby?
RPA is available from http://www.rubyarchive.org/

The problem is caused by a superfluous , in loadpath_manager.rb, line
63:
Dir.glob("{#{($LOAD_PATH).join(',')}}/#{file}{,.rb,.so}")
has one comma to many. With:
Dir.glob("{#{($LOAD_PATH).join(',')}}/#{file}{.rb,.so}")
it runs fine.

Of course, it's still a dir.c bug, but the workarounf is quite easy <g>.

Cheers,

Han Holl

···

On Wednesday 17 November 2004 01:28, Chad Fowler wrote:

Thanks, Han! I haven't had time to test the latest 1.8.2 with
RubyGems (or anything else) yet, so I haven't run into this. You
appear to be correct that there is some problem introduced by the
dir.c change.

Well, it doesn't run so fine. The , had a function after all.
Now fcgi.rb is no longer found, so dispatch.cfgi no longer works. (rails)

I'll try to klodge around it anyway.

Cheers,

Han Holl

···

On Wednesday 17 November 2004 16:30, Han Holl wrote:

63:
Dir.glob("{#{($LOAD_PATH).join(',')}}/#{file}{,.rb,.so}")
has one comma to many. With:
Dir.glob("{#{($LOAD_PATH).join(',')}}/#{file}{.rb,.so}")
it runs fine.

Hi,

···

In message "Re: Parsing error in 1.8.2 Dir.glob" on Wed, 17 Nov 2004 20:35:54 +0900, Mauricio Fernández <batsman.geo@yahoo.com> writes:

rpa-base pre-0.2.3 was broken by a change in ruby_1_8/HEAD
(lib/ostruct.rb), too.

I consider that change to be a bug and will fix it before the stable
release. The problem is that I don't know how to fix it yet.

              matz.