Problems with require in eruby

V

Vasyl Smirnov

Hi,

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.

good.rb:
<%
require 'set'
puts "works"
%>

bad.rb:
<%
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
500s.
From error.log:

[Wed Oct 24 18:05:34 2007] [error] mod_ruby: /usr/local/lib/ruby/1.8/
i386-freebsd6/stringio.so: 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
libraries?

Has anybody got (and solved) this problem?

Thanks!

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

Vasyl Smirnov

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

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,962
Messages
2,570,134
Members
46,692
Latest member
JenniferTi

Latest Threads

Top