Problem loading files in Ruby CGI scripts

T

Toby Rodwell

This is not a Ruby problem as such, but I'm hoping someone will have
come across this problem before and can advise.

I have a basic CGI script, that loads a YAML file and prints out HTML
and a few calculated results. The script works fine when I run it from
the command line, but (no surprise!) I have problems when trying to
access it from a browser. The error message in the APache log
(abbreviated) is " No such file or directory -
/usr/local/lib/ruby/1.8/sparc-solaris2.9/stringio.so (LoadError)
from /usr/local/lib/ruby/1.8/yaml.rb:9"

I guess this must be something to do with permissions, or environment,
because the file referred to *does* exist. Broadly speaking, from a few
basic tests, it seems that none of the 'requires' are working.

Any ideas?

thanks in advance
 
T

Toby Rodwell

Glen said:
Only some obvious ones. Is your environment set up correctly? Does the
Apache uid have access to those files? Are you running Apache in a
chroot
jail?

The file permissions seem OK (all can be read by anybody). I don't know
about a chroot jail (I'm not the sys admin). As far as environment is
concerned I must admit I don't know how to check or alter that - can you
point me in the right direction? Thanks again.
 
T

Toby Rodwell

Problem solved - my sys admin sorted me out with an .htaccess file,
which for the record is:

SetEnv LD_LIBRARY_PATH
/usr/local/lib:/usr/sfw/lib:/net/dante-sw/lib:/usr/ccs/lib:/usr/lib:/lib
SetEnv LD_RUN_PATH
/usr/local/lib:/usr/sfw/lib:/net/dante-sw/lib:/usr/ccs/lib:/usr/lib:/lib


and that did the trick!
 

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,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top