Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby Building Web Apps with Sinatra Your First Sinatra App Your First App

Matthew Timmons
Matthew Timmons
33,804 Points

This site can’t be reached

I run produce.rb in the console, and it says that the server is running on port 4567, but when I type http://localhost in my web browser, it says, "This site can’t be reached." Then when I try http://localhost/4567 like in the video, instead of saying, "Sinatra doesn't know this ditty," I get the same error message, "This site can’t be reached." Lastly, after typing http://localhost/4567/apple, I still get the same error message.

1 Answer

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

Hi Matthew,

To access a port number, you use a colon, not a slash as you have above. So...

http://localhost/4567

should be

http://localhost:4567

Otherwise you will get a 404. Jay mentions this at 4:01 in the video.

Keep coding! :) :dizzy:

Matthew Timmons
Matthew Timmons
33,804 Points

Thank you for your response! That was actually a typo on my part while writing my question. Although I had been typing it correctly in the address bar, it had not been working. Well instead of doing it in workspaces, I downloaded ruby and Sublime Text onto my computer, created and ran the file, and then typed "http://localhost:4567/apple" into my address bar and was able to get the text like in the video.

Thanks again for the help!