ktulx Posted November 24, 2013 Share 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. Link to comment Share on other sites More sharing options...
Byron Posted November 24, 2013 Share 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 Link to comment Share on other sites More sharing options...
ktulx Posted November 24, 2013 Author Share 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? Link to comment Share on other sites More sharing options...
ktulx Posted November 24, 2013 Author Share 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!" Link to comment Share on other sites More sharing options...
Recommended Posts