ktulx Posted November 24, 2013 Posted November 24, 2013 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.
Byron Posted November 24, 2013 Posted November 24, 2013 I've never used Ruby but I'll try to help you until another admin. comes along. Have you set up Ruby at your cpanel here? http://johnny.heliohost.org:2082/frontend/x3/ror/index.html Also try this as the shebang line:#!/usr/bin/env ruby
ktulx Posted November 24, 2013 Author Posted November 24, 2013 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?
ktulx Posted November 24, 2013 Author Posted November 24, 2013 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!"
Recommended Posts