But still, Rack is a middleware-piece, that does not exist when the site is compiled to static HTML files. Rack (and other Ruby/Rails niceties) are only used in developer mode, when Middleman dynamically creates pages on-the-fly. It is possible to use Middleman in developer-server mode on production server (Heroku, others), but it doesnโt make much sense. If you need any dynamic features then it is better to use Sinatra, Rails or anything other that works as a dynamic web-app.
I love Middleman and I mix it with some PHP code in one of the projects (long story), but using it as Ruby-based dynamic web-app is a little bit odd. Where Middleman shines is when you need to update the static content from time to time, or generate/update static content from some text/database/xml/whaterver source using the /data/ folder to generate pages. Blog extension is very useful and allows to custom-program many features โ and then compile it to static site. You can plug the dynamic comment system (based on Disqus) or dynamic search feature, but primarily you have a static set of generated HTML files.