Serving Ruby Code to the Web

Ruby is commonly used as the back end of a web application. In this pattern, a request is made to a web server, which executes Ruby code. The Ruby code returns HTML (usually), which is sent back to the web browser as the response.

While you could write all this in plain Ruby yourself, there’s no need for you to do all that work. The Ruby ecosystem has multiple web servers, including Puma,[32] Unicorn,[33] Thin,[34] and Falcon.[35] You can also use multiple web frameworks, including Ruby on Rails,[36] Sinatra,[37] Roda,[38] and Hanami.[39]

You might look at that incomplete list of web servers and frameworks and think that compatibility between the two sets might be a nightmare of continually having to adjust the ...

Get Programming Ruby 3.3 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.