How to load a formula into Sinatra

Can someone tell me how to put up a file like the one i have attached on
the web using sinatra. Right now, i use the gem, ocra, to convert it to
.exe files. I would really appreciate it if someone can give me a link
to a tutorial regarding this or just show me the steps…and i can learn
from that point. I have read lots of material on sinatra…but none of
them are specific to formulas or anything mathematical. Thanking in

T J Pereira