# Problems with require in eruby

**URL:** <https://www.ruby-forum.com/t/problems-with-require-in-eruby/118188>\
**Category:** Ruby\
**Created:** [October 24, 2007, 5:10pm UTC](https://www.ruby-forum.com/t/problems-with-require-in-eruby/118188 "2007-10-24T17:10:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vasyl\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/4bbf92/32.png) [@Vasyl\_S](https://www.ruby-forum.com/u/Vasyl_S)\
**Post date:** [October 24, 2007, 5:10pm UTC](https://www.ruby-forum.com/t/problems-with-require-in-eruby/118188/1 "2007-10-24T17:10:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Vasyl\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/4bbf92/32.png) [@Vasyl\_S](https://www.ruby-forum.com/u/Vasyl_S)\
**Post date:** [October 24, 2007, 5:45pm UTC](https://www.ruby-forum.com/t/problems-with-require-in-eruby/118188/2 "2007-10-24T17:45:27Z")

</div>

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