Ruby-based websites not working -- newly migrated

Heya, all.
Just finishing the migration to Virtualmin Pro. I’m pretty pleased so far, but I have encountered a “gotcha”. None of my .rhtml sites are working. Instead, I’m getting the dreaded file-download from my browser.

Obviously Apache is not realizing it is supposed to put the index.rhtml through the /cgi-bin/ruby.cgi

I just checked and the config file for domain was missing the “AddType application/x-httpd-ruby .rhtml” to permit .rhtml. As well, you’ll have to add it to the DirectoryIndex (index.rhtml) because its not there by default.

However, having fixed those issues myself, I’m now getting errors rendering the page. Essentially, the ruby.cgi is choking on the file contents. Now, this is the same file that runs just fine on the old server. I’m having some problems figuring out what the problem here is.

Does anyone have experience getting Ruby to serve up .RHTML? I’ve got two customers down at this point, and I’m looking at have to roll back to the original servers. I’d rather not do that.

Instead, I'm getting the dreaded file-download from my browser.

I don’t think I’ve ever dreaded this behavior. :wink:

Obviously Apache is not realizing it is supposed to put the index.rhtml through the /cgi-bin/ruby.cgi

Why would it? This is the first I’ve ever heard of .rhtml. I suppose it is a Ruby template language?

You haven’t given us any errors to go on. You just said you’re getting errors. We can’t read your mind. :wink:

Check the error_log for the site in question and the system-wide suexec log, and of course include whatever error is in the browser.

And, maybe this is a dumb question, but have you checked to be sure these files run from the command line? Maybe the Ruby versions are different and you have syntax errors or similar in your code. This would lead to a 500 error, since Apache would be seeing no header in your file.

Thanks for your reply, Joe. Your remark about not having heard of ".rhtml" reminded me the piece that was not coming to mind. .rhtml files are "eRuby" templates. I manually plugged the eRuby config into the system, and that fixed it.

The original system I am migrating from was a bare-metal hand-rolled installation that is five years old… I forgot a couple of the details. :slight_smile: