Problems with require in eruby


I’ve just set up eruby and mod_ruby to handle .rb files in the
document root dir.

The problem is that certain 'require’s work, and others don’t.

require ‘set’
puts “works”

require ‘stringio’
puts “not always”

The first script always works fine, but the second gives a 500
Internal Server Error the first time it’s requested; then, holding
Ctrl-R in Firefox, it runs correctly almost always, with occasional

From error.log:

[Wed Oct 24 18:05:34 2007] [error] mod_ruby: /usr/local/lib/ruby/1.8/
i386-freebsd6/ StringIO is already defined (NameError)

Looks like require fails with binary libraries (like stringio), and
works fine with ruby libraries (like “set”).
Does eruby(mod_ruby) has to be commanded to somehow reload/unload the

Has anybody got (and solved) this problem?


Config: mod_ruby-1.2.6, apache-2.2.4, ruby-1.8.6-p111, eruby-1.0.5,
FreeBSD 6.2-RELEASE-p7

(old reply looks like lost, reposting)

I’ve found a workaround in the face of

RuybRequire auto-reload

but still confused with the “for debug” mark, and that it reloads
everything on each request.