To evaluate the Ruby code manually you can use the erb
command.
Given a index.html.rhtml
file with the following content:
<html><body>Hello <%= "from Ruby" %></body></html>
Running:
$ erb index.html.rhtml > index.html
Results in a index.html
file with:
<html><body>Hello from Ruby</body></html>
This file can be viewed in a browser.
Another option is to use a web server to convert and serve the files. Here's a one liner starting WebBrick on port 3000 (assuming a index.html.rhtml
file in the current directory):
$ ruby -rwebrick -e "WEBrick::HTTPServer.new(:DocumentRoot => '.', :Port => 3000).start"
Pointing your browser to http://localhost:3000/index.html.rhtml
should show the page.