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

Localhost:3000 not coming up on my macbook pro.

Hey everybody I've been through the forum and cannot seem to find somebody with the exact issue that I have. When I type localhost:3000 in my URL it says data not received. It was working just fine then my mac got really hot so I shut it down to cool off. I'm back up, I've reopened sublime text and my terminal. I went into the treehouse server and restarted the ruby server.

At first I was told sever not found. So i exited and ran the same commands again and I am being told the same thing. How can I access/ correct this so I can move forward with the project. Thanks in advance.

10 Answers

Joseph Kato
Joseph Kato
35,340 Points

Were you able to get it working?

If not, as Maciej was saying, you're experiencing a file path issue. More specifically, the command bin/rails server is looking for a bin directory within your current location, then a rails file within the bin directory. In your case, it appears that you're just in the wrong location.

You should be able to fix this one of two ways (assuming you're in the treehouse directory):

  1. Use the command projects/your_project_name/bin/rails server. Where your_project_name is the name of the project you're currently working on.

  2. Move to the project directory with the command cd projects/your_project_name, then run bin/rails server.

The process can be seen in this video, too.

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

Exactly: type "cd projects/your_project_name" and then you can use server and git commands.

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

Can you copy the output that you're getting in your terminal after entering the "rails server" command in your app folder?

treehouse:~ $ bin/rails server -bash: bin/rails: No such file or directory treehouse:~ $

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

Is this inside the directory where your app resides?

I've also tried 2 check the status of my git and this is what i get : treehouse:~ $ git status fatal: Not a git repository (or any of the parent directories): .git treehouse:~ $

Am I not entering the directories properly? When I type: cd treehouse/

Or: vagrant up

&: vagrant ssh

I don't have any problem there.

When I get to git and the server , that's when the problem starts.

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

Can you type "ls" and tell me what folders and files you get listed?

projects tmp

That's it.

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

Ok, in order for "rails server" or any git command to work, you have be in the folder that has your application (such folder contains folders such as app, bin, config, db, lib, log, public and a few others). I assume you have your app somewhere in the projects folder.

Yes it's in the treehouse projects folder.

Thank you for the responses I will try this in the morning. As soon as I do whether it works or not I will update.

Okay I have been battling this for a while this morning and still running into a problem. I tried both methods/steps that you suggested Joseph Kato. The second one has worked to the point that it allows me to view and interact with localhost:3000. The problem that I am facing now is that once I get to this point I'm stuck. I cannot make changes in the Terminal any longer, it just is not doing it. I tried opening a new tab and running command in it but that has not helped either.

I tried the new tab because that is what was done in the video. I'm still stuck. When I try to run the bin/rails server I'm told tha the file does not exist. So i tried projects/odot/bin/rails server once again I'm told that the directory does not exist even though the localhost:3000 is up and running now.

Is it always this difficult to get back to the project that you're working on? And do you'll have any suggestions as to how I can move forward from this point ? Thank you in advance.

Joseph Kato
Joseph Kato
35,340 Points

Hi Peaches,

If you have the rails' server running in Terminal, then open another tab, you need to navigate back to your odot directory to run other project-related commands. Depending on where your treehouse directory is located, this should be done with something along the lines of: cd treehouse/projects/odot/

At this point, you should have the server running in one tab and still be able to execute project-related commands (such as git) in the second tab. The other option is to stop the server with Ctrl+C, then you'll be able to run other commands in the original tab.

Also, if you're interested and haven't already taken it, there's a course called Console Foundations, which covers many relevant commands.

Okay I basically retraced my steps doing some of the exact same things that I did this morning. This time they just worked. In the initial tab I typed: cd treehouse/ vagrant up vagrant ssh

Then I went to the second tab and typed: cd treehouse/projects/odot/ vagrant ssh cd treehouse/projects/odot/bin/rails server

This allowed me to work on the project, and to view localhost. Thanks for the support guys and, if anybody else faces this problem and need help let me know I will try my best to help you.

Hi there. I am having a problem launching my server correctly. I accomplished this task in the "Set Up An Environment..." video, yet now in the TODO App video, I am having issues.

So I am in my appropriate path... projects\odot\> and I go to launch rails.

bin/rails server and it returns

'bin' is not recognized as an internal or external command...

So I switch to the bin folder, and now I am in;

projects\odot\bin> and I go to launch the server;

rails server and the server launches, and it makes the statement that my application is running at http://0.0.0.0:3000

However nothing is present at localhost:3000.

I am running Windows, using the command prompt.

Any help?

Joseph Kato
Joseph Kato
35,340 Points

Have you tried 127.0.0.1:3000? They should be the same, but I've seen cases where only one worked due to the current host file configuration.

Hey there, Joseph.

Unfortunately, no.