Forum: Ruby eruby and DirectoryIndex

34789f175f100981cb99b5b7c78c5275?d=identicon&s=25 Matt Watson (mwatson)
on 2014-06-13 16:54
I am having issues with .htaccess and DirectoryIndex pointing at
index.rhtml. Below, I have pasted the contents of the three pertintent
files.

============ FILE CONTENTS: domain.com/ruby/.htaccess ===============
Action eruby-script /cgi-bin/eruby
AddHandler eruby-script .rhtml
DirectoryIndex index.rhtml
---------------------------------------------------------------------

========== FILE CONTENTS: domain.com/ruby/cgi-bin/eruby =============
#!/bin/sh
echo "Content-type: text/html"
echo
echo "<!DOCTYPE HTML>"
exec /usr/local/bin/erb /home/mathwats/public_html/ruby${REQUEST_URI}
---------------------------------------------------------------------

=========== FILE CONTENTS: domain.com/ruby/index.rhtml ==============
<html>
<body>
    <h1>This is index.rhtml</h1>
    Time: <%= Time.now %>.<br />
</body>
</html>
---------------------------------------------------------------------

* Nagivating straight to <domain.com/ruby/index.rhtml> outputs the
contents of index.rhtml just fine.

* Navigating to <domain.com/ruby/> simply gives me a blank page, and the
server logs the following error

 > /usr/local/bin/erb:118:in `read': Is a directory -
/home/domain/public_html/ruby/ (Errno::EISDIR)

* Removing the third line "DirectoiryIndex index.rhtml" from .htaccess
and navigating to <domain.com/ruby/> gives me the "Index of /" directory
listing page.

Any help would be very appreciated.

- Matt
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.