PDA

View Full Version : Ruby "Hello World" in a .php or .htm page


grolock51
July 25th, 2008, 06:59 PM
I am new to ruby and cant even figure out how to get a hello world to display in a php or .htm page. I have bought books and read forums but found no way to get my ruby program to display in a .htm or .php page. (is this even possible?) Do you need a cgi file? Is the only way in a .rhtml file? I would be happy with just a hello world example. I think I can take it from there.

I have a linux server with ruby installed but no command line access. I am really good with php but no idea how to get ruby working with it.

Thanks

rob
July 25th, 2008, 07:08 PM
Ruby can't run in a PHP script, you would need to use an .rhtml file and mod_ruby (http://modruby.net/en/) to do what you're wanting to do.

You might also want to check out Ruby on Rails (http://www.rubyonrails.org/).