Parsing error in 1.8.2 Dir.glob

H

Han Holl

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
from :0
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
 
H

Han Holl

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
 
C

Chad Fowler

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

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.
--

Chad Fowler
http://chadfowler.com
http://rubycentral.org
http://rubygarden.org
http://rubygems.rubyforge.org (over 20,000 gems served!)
 
M

Mauricio Fernández

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.

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.
 
H

Han Holl

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.

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
 
H

Han Holl

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.
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
 
Y

Yukihiro Matsumoto

Hi,

In message "Re: Parsing error in 1.8.2 Dir.glob"

|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.
 

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

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,586
Members
45,096
Latest member
ThurmanCre

Latest Threads

Top