PDA

View Full Version : ruby no rails



johnnysocko
10-18-2008, 08:16 AM
Why can't the web server run a simple vanilla ruby script, say in cgi-bin?

where cgi-bin/test.rb=

#!/usr/bin/ruby

puts "<html><body><p>Hello World</p></body></html>"


It doesn't work. Gives a 500 server error.

cade
10-18-2008, 06:46 PM
The error has nothing to do with the server-- your script is incomplete. You would need to output a content type for it to work (or some derivative):


print "Content-type: text/html\n\n"
puts "<html><body><p>Hello World</p></body></html>"