[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Rail fails after update of Debian

Yuu

11/28/2004 8:58:00 PM

Hi there,

Bit too Rail specific perphaps, but I'm very much a newbie so maybe that
will give me some slack :-)

After an update of Debian (testing) today, which seemed to update a
whole bunch of ruby related packages, I've got both Gem and Rails
(locally installated) crashing on me. Stacktrace:

usr/local/lib/site_ruby/1.8/rubygems/loadpath_manager.rb:63:in
`directory?': string contains null byte (ArgumentError) from
/usr/local/lib/site_ruby/1.8/rubygems/loadpath_manager.rb:63:in
`search_loadpath'

The offending line is
result =
Dir.glob("{#{($LOAD_PATH).join(',')}}/#{file}{,.rb,.so}").delete_if {
|f| File.directory?(f)}.size > 0

it seems to crash on the file

/usr/lib/ruby/gems/1.8/gems/activerecord-1.1.0/lib/active_record/vendor/simple.rb

But as fas as I can see the filename doesn't contain any null-bytes.

On another machine I didn't perform the upgrade and there everyting
works as before.

Does anyone have any clue?

Regards,

Iwan
3 Answers

Mauricio Fernández

11/28/2004 9:46:00 PM

0

On Mon, Nov 29, 2004 at 05:57:52AM +0900, Iwan van der Kleyn wrote:
> usr/local/lib/site_ruby/1.8/rubygems/loadpath_manager.rb:63:in
> `directory?': string contains null byte (ArgumentError) from
> /usr/local/lib/site_ruby/1.8/rubygems/loadpath_manager.rb:63:in
> `search_loadpath'
[...]
> Does anyone have any clue?

Thu Nov 25 10:14:26 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>

* dir.c (push_braces): do not reuse buffer strings. [ruby-core:03806]

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


craig duncan

11/29/2004 4:59:00 PM

0

Mauricio Fernández wrote:

>On Mon, Nov 29, 2004 at 05:57:52AM +0900, Iwan van der Kleyn wrote:
>
>
>>usr/local/lib/site_ruby/1.8/rubygems/loadpath_manager.rb:63:in
>>`directory?': string contains null byte (ArgumentError) from
>>/usr/local/lib/site_ruby/1.8/rubygems/loadpath_manager.rb:63:in
>>`search_loadpath'
>>
>>
>[...]
>
>
>>Does anyone have any clue?
>>
>>
>
>Thu Nov 25 10:14:26 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
>
> * dir.c (push_braces): do not reuse buffer strings. [ruby-core:03806]
>
>
>
What this cryptic response means is that a bug was introduced in 1.82.
This has been fixed in CVS (which i guess means version 1.9.0). But,
unfortunately, the debian 1.8.2 package hasn't been updated with the fix
yet. What i did was download the (stable) 1.8.1 release from
ruby-lang.org and compile it. Unfortunately, even though i changed the
paths in config.h (RUBY_LIB, RUBY_SITE_LIB, ...) to correspond with the
proper Debian locations, make install _still_ put some things in the
wrong places (my intention was to overwrite the existing debian-supplied
ruby stuff). Anyway, some manual moving of things around will get it to
work. Maybe the best solution would be to pin to debian-stable for ruby
stuff. That's not really so great either, though. We're too close to
the bleeding edge with rails right at the moment (because after the
update, a number of things had changed between old and new
rails-generated files, also).


Mauricio Fernández

11/29/2004 5:55:00 PM

0

On Tue, Nov 30, 2004 at 01:58:33AM +0900, craig duncan wrote:
> >>usr/local/lib/site_ruby/1.8/rubygems/loadpath_manager.rb:63:in
> >>`directory?': string contains null byte (ArgumentError) from
> >>/usr/local/lib/site_ruby/1.8/rubygems/loadpath_manager.rb:63:in
> >>`search_loadpath'
> >>
> >>Does anyone have any clue?
> >
> >Thu Nov 25 10:14:26 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
> >
> > * dir.c (push_braces): do not reuse buffer strings.
> > [ruby-core:03806]
>
> What this cryptic response means is that a bug was introduced in 1.82.
> This has been fixed in CVS (which i guess means version 1.9.0). But,
> unfortunately, the debian 1.8.2 package hasn't been updated with the fix
> yet.
> What i did was download the (stable) 1.8.1 release from
> ruby-lang.org and compile it. Unfortunately, even though i changed the
> paths in config.h (RUBY_LIB, RUBY_SITE_LIB, ...) to correspond with the
> proper Debian locations, make install _still_ put some things in the
> wrong places (my intention was to overwrite the existing debian-supplied
> ruby stuff). Anyway, some manual moving of things around will get it to
> work. Maybe the best solution would be to pin to debian-stable for ruby
> stuff. That's not really so great either, though. We're too close to

[...]

Sorry for the exceedingly short answer.
The problem is caused by some recent modifications in the ruby_1_8 branch
(also in HEAD). That was fixed on Nov 25, so if you get & compile a
recent stable-snapshot RubyGems will work fine. You need not switch to
1.9 for that.

You can also apply the patch I posted under
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-t...
to RubyGems' sources. That should fix the RubyGems issue you're
experiencing, regardless of the ruby version you use.

If you want to build your own Debian package corresponding to the latest
stable version from CVS, fetch the tarball, apt-get source ruby1.8,
and place it under ruby1.8-1.8.1+1.8.2pre2/ with a suitable name.
You'll have to remove several patches from debian/patches (they have
already been applied to that codebase). Then run fakeroot debian/rules
to create the binary packages.

If you want to overwrite the files managed by Debian (not a good idea),
just set the --prefix explicitly when running ./configure instead of
editing config.h. The settings used by Debian are (slightly edited):

/configure --prefix='/usr' --datadir='/usr/share' --mandir='/usr/share/man' --sysconfdir='/etc' --localstatedir='/var' --with-sitedir='/usr/local/lib/site_ruby' --with-default-kcode=none --with-dbm-type=gdbm_compat --with-tklib=tk8.4 --with-tcllib=tcl8.4 --with-tcl-include=/usr/include/tcl8.4 --with-bundled-sha1 --with-bundled-md5 --with-bundled-rmd160 --enable-pthread --enable-shared --enable-ipv6 --with-lookup-order-hack=INET

Hope this helps.

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