JIHUNYOON / mongoose

Automatically exported from code.google.com/p/mongoose
MIT License
0 stars 0 forks source link

Ruby 1.9.3 -- does it work with Mongoose? #343

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi folks,

I'm having a problem getting mongoose to interpret Ruby like CGI.  Instead of 
getting the actual Ruby output, I'm getting the actual contents of the Ruby 
file (as if it were dumping a text file).

Here is my mongoose.conf

document_root /home/andy/mongoose/ccweb
cgi_interpreter "/home/andy/.rvm/rubies/ruby-1.9.2-p318/bin/ruby"
cgi_pattern .rb
listening_ports 8000                                                            

index_files index,home

Here is the mongoose server start script:

#!/bin/bash
runtime/mongoose -e error.log 

The server runs fine, returning:

Loading config file runtime/mongoose.conf
Mongoose web server v. 3.1 started on port(s) 8000 with web root 
[/home/andy/mongoose/ccweb]

When I hit the url http://localhost:8000/index.rb, I get:

#!/home/andy/.rvm/rubies/ruby-1.9.2-p318/bin/ruby
print "HTTP/1.0 200 OK\r\n"
print "Content-type: text/html\r\n\r\n"
print "<html><body>Hello World!</body></html>\r\n"

I really should be getting a simple "Hello World!"  For some reason, I am not.  
Can anyone offer any advice?  Thank you.

Andy

Original issue reported on code.google.com by ananon...@gmail.com on 11 Apr 2012 at 12:39

GoogleCodeExporter commented 8 years ago
cgi_pattern **.rb$

Original comment by valenok on 11 Apr 2012 at 10:29

GoogleCodeExporter commented 8 years ago
valenok -- thank you!  Mongoose is now recognizing Ruby scripts properly.

Original comment by ananon...@gmail.com on 11 Apr 2012 at 4:42