Jump to content

Recommended Posts

Posted

Hi.

I'm trying to run a simple test script in Ruby, but can't figure out what's wrong. The files are 755 chmod.

I've tried

 

#!/usr/bin/ruby
header("text/html; charset=utf-8")
puts 'Hey!'

 

and a test.cgi

 

#!/usr/bin/ruby
require 'cgi'
cgi = CGI.new
puts cgi.header
puts "<html><body>Test</body></html>"

 

Do I miss something?

Thanks.

Posted

Hi byron. Thanks for your help.

Right now I can't access my domain, it seems to be down. But I've tried the shebang line you suggested earlier, and it changes nothing.

What do you mean by "set up Ruby at your cpanel"? What kind of setup does it need?

Posted

Got it to work :)

Seems like it was the "content-type" line. The following worked this time:

test.rb

 

#!/usr/bin/ruby
puts "Content-type: text/html\r\n\r\n"
puts "Hello Ruby!"

Guest
This topic is now closed to further replies.
×
×
  • Create New...