Forum: Ruby Problem loading files in Ruby CGI scripts

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
088110fadfa112d1d2f73204a26e111a?d=identicon&s=25 Toby Rodwell (alansmithee)
on 2007-05-15 15:14
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
9d4960f8319664f0f7896230eebace73?d=identicon&s=25 Glen Holcomb (Guest)
on 2007-05-15 16:23
(Received via mailing list)
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?

On 5/15/07, Toby Rodwell <ruby@tobyrodwell.com> wrote:
> from /usr/local/lib/ruby/1.8/yaml.rb:9"
> Posted via http://www.ruby-forum.com/.
>
>


--
"Hey brother christian with your high and mighty errand, Your actions
speak
so loud, I can't hear a word you're saying."

-Greg Graffin (Bad Religion)
088110fadfa112d1d2f73204a26e111a?d=identicon&s=25 Toby Rodwell (alansmithee)
on 2007-05-15 16:42
Glen Holcomb wrote:
> 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.
9d4960f8319664f0f7896230eebace73?d=identicon&s=25 Glen Holcomb (Guest)
on 2007-05-15 17:25
(Received via mailing list)
It sounds like your environment is probably okay, you said things work
from
the command line.  However if Apache is running chroot then it is
possible
it can't get to files on the regular filesystem.  Then again the error
message you are getting is coming from yaml.rb which it seems to find
without any trouble.

I suppose it could be an ACL type issue although I haven't used solaris
in
years and don't know what equivalent they have.

I'm afraid without seeing the machine I can't be of much more help.  My
suggestion would be to see if the sys admin can help you out.

Sorry.

On 5/15/07, Toby Rodwell <ruby@tobyrodwell.com> wrote:
> point me in the right direction?  Thanks again.
>
>
> --
> Posted via http://www.ruby-forum.com/.
>
>


--
"Hey brother christian with your high and mighty errand, Your actions
speak
so loud, I can't hear a word you're saying."

-Greg Graffin (Bad Religion)
088110fadfa112d1d2f73204a26e111a?d=identicon&s=25 Toby Rodwell (alansmithee)
on 2007-05-15 21:01
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!
This topic is locked and can not be replied to.