Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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

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,627 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:

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!