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

When i open terminal, how do i access my "Treebook" directory so i could see what ive done on localhost:3000

if i shut off my computer and open it again, i have to open terminal and do some basic coding in order to view everything from my "social network" ?

7 Answers

Ahhhh I got you now!

You'll need to use the cd command to get to the particular directory.

In my example, I would have to type like this:

cd

And if you're on a Mac, a super secret trick that is not-in-the-spirit-of-using-the-command-line-but-will-get-the-job-done: you can just command-drag the folder to Terminal instead of having to cd into the directory's path.

Now...if you're not sure where your project folder is, you're going to just need to find it. :smile:

Hope this works!

Hi Danny,

If I understand your question correctly, you'll need to run the command rails s (or the longer version, rails server ) from the directory where you saved your project.

Hope this helps!

yeah i knew that. i just dont know how to do it from terminal. i just type in rails server but localhost is unavailable...i know i got to do something with the directory but i dont remember how to

Hi Danny,

I'm not sure I understand completely. So, for instance: I have a project named readone in my own projects directory. When I type the command start the server in that directory, this is what it looks like:

railss

And then I can access it at http://localhost:3000/.

Does that help, or am I missing something? :grinning:

lol how do you access your specific directory first. cause when i open it its just my name. but when i was working it was my name and "treebook" as well...now when i open it its not there no more, i know i gotta command it to bring it back, but i dont remember how.

OH YAHHHHHH!!! LOL Thanks !!

than i type in "rails server" to get it connected to localhost:3000, right?

Well, you'll type that, and then you'll have to open your browser and enter http://localhost:3000/ to see it. :thumbsup:

got ya. thanks