Auto-Require some .rb files for specific .cgi page

I am using Linux + Apache + ruby 1.8.7 (2009-06-08 patchlevel 173)

I use quite many .cgi pages which are nothing more than .rb files
which output a html string.

I found that every of this .cgi page requires my “web.rb” file.

Is it somehow possible to auto-load this file without doing
require ‘web.rb’? It is tedious to require that web.rb for every
ruby .cgi page. I wonder if what I would like to have is
somehow possible at all.

Marc H. wrote:

somehow possible at all.
You can add ‘-r somefile.rb’ to ruby command string, so the whole
command will become ‘ruby -r web.rb script.rb’, for example. Try
modifying shebang line/apache options/etc. for this.