This course will be retired on June 1, 2025.
Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll

- 2x 2x
- 1.75x 1.75x
- 1.5x 1.5x
- 1.25x 1.25x
- 1.1x 1.1x
- 1x 1x
- 0.75x 0.75x
- 0.5x 0.5x
We'll talk about how Sinatra can help you create web apps. Then we'll show you how to create and run a simple app.
If you'd like to know more about Ruby Gems and how they're installed, check out our RubyGems course.
We showed you how to set Sinatra's :bind
configuration option in this video, but that's just one of many options. If you'd like to learn about the rest, here's the official documentation.
Troubleshooting
Here are some possible problems you might encounter, along with potential solutions for each. If you can't solve your issue with what's here, use the link on this page to ask a question in our Community forum.
"Workspace Unavailable":
- Either the server isn't running, or your browser can't connect to the preview using the current options.
- Did you add
set :bind, '0.0.0.0'
within your application code? - Did you start the server from the console?
No "Port 4567" option in Workspace Preview menu:
- Previewing particular ports isn't available in some Workspace environments. Copy your code to a new Workspace based on the Ruby environment, and you should have the "Port 4567" option.
"This site can't be reached":
- Did you start the server from the console/terminal?
- Did you specify the port when typing a URL into your browser?
"Sinatra doesn't know this ditty":
- You're connected to the server, but Sinatra doesn't know how to handle your request.
- Did you make a typo in the URL?
- Did you make a typo when specifying the path in your code?
"Someone is already performing on port 4567.":
- Another app, possibly another Sinatra app, has already claimed port 4567 on your machine.
- Look for any other terminal windows that might be running a Sinatra app. If you find one, press Control-C to halt the app and free up the port.
- Try specifying a different port when you run your app. To run on port 4568, for example, use "
ruby myapp.rb -p 4568
".
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up-
Iuliia Shevtsova
13,274 Points0 Answers
-
anthonybrackner
17,776 Points3 Answers
-
Christopher Phillips
10,061 Points0 Answers
-
Michael Mannucci
3,457 Points2 Answers
-
MaryAnn Eleanya
8,626 Points2 Answers
-
Matthew Timmons
33,804 Points1 Answer
-
Jonathan Magolnick
2,318 Points1 Answer
-
Aaron Feltman
8,434 Points1 Answer
View all discussions for this video
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up