Setting up Ruby CGI in Apache
Few things to check:
- is your file executable? You can make it executable by going
chmod +x /path/to/file
- did you output the correct Content-type?
- is there a blank newline between your headers and your output?
- did you restart Apache after setting the configuration?
If you did all that, it should work fine. I have this as my test.rb file:
#!/usr/bin/env rubyputs <<EOSContent-type: text/html<html><body>hi</body></html>EOS