Chapter 14. Web Apps: Serving HTML

image with no caption

This is the 21st century. Users want web apps. Ruby’s got you covered there, too! Libraries are available to help you host your own web applications and make them accessible from any web browser. So we’re going to spend these final two chapters of the book showing you how to build a full web app.

To get started, you’re going to need Sinatra, a third-party library for writing web applications. But don’t worry, we’ll show you how to use the RubyGems tool (included with Ruby) to download and install libraries automatically! Then we’ll show you just enough HTML to create your own web pages. And of course, we’ll show you how to serve those pages to a browser!

Writing web apps in Ruby

An app that runs in your terminal is great—for your own use. But ordinary users have been spoiled by the Internet and the World Wide Web. They don’t want to learn to use a terminal so they can use your app. They don’t even want to install your app. They want it to be ready to use the moment they click a link in their browser.

image with no caption

But don’t worry! Ruby can help you write apps for the Web, too.

We won’t lead you on—writing a full web app is not a small task, even using Ruby. This is going to require all of the skills you’ve learned so far, plus a few new ones. But Ruby has some excellent ...

Get Head First Ruby 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.