JavaScript Required.
We're sorry, but Pega7 doesn't work without JavaScript enabled. Please enable and refresh.
<h2>Set Up Your cgi-bin Folder</h2> <p>You need to add an 'eruby' script to your '~/public_html/cgi-bin' folder. Here's what it should look like:</p> <pre> #!/bin/bash echo "Content-type: text/html" echo echo "<!DOCTYPE HTML>" erubis -E Stdout <$DOCUMENT_ROOT$REQUEST_URI</pre> <p>Save the above file as '~/public_html/cgi-bin/eruby' and change its permissions to be executable.</p> <h2>Set Up Your .htaccess File</h2> <p>Finally, you'll need to create an .htaccess file in your '~/public_html/' folder and add the following three lines:</p> <pre> Action eruby-script /cgi-bin/eruby AddHandler eruby-script .rhtml DirectoryIndex index.html index.rhtml</pre> <p><br /> This will cause any *.rhtml files to load the eRuby script that we just set up, and that file will send the 'rhtml' file through the eRuby parser before displaying it to the user.</p> <h2>Set Up a Rewrite Rule</h2> <p><em>*This is an optional step.</em></p> <p>If you don't like having a 'rhtml' hanging off the end of your URLs, you can add this to the .htaccess file as well:</p> <p><br /> RewriteEngine on<br /> RewriteRule ^(.*)(?<!\.rhtml)$ $1.rhtml [L] </p> <p>Now you can upload files ending in '.rhtml' that contain Ruby code enclosed in <% %> or <%= %> markers and have the contents run as Ruby:</p> <pre> <html> <body> 1 and 2 is <% puts 1 + 2 %> </body> </html></pre> <p><br /> If you are receiving a 404 (not found) error after setting this up you may need cgi privileges enabled on your account. You can open a support ticket and we will be happy to enable this for you.</p>