Problem connecting to localhost:3000

226 views
Skip to first unread message

Gaba Luschi

unread,
Mar 3, 2011, 12:06:16 PM3/3/11
to rubyonra...@googlegroups.com
Hi,
After typing "rails server", I tried to go to http://localhost:3000, as
well as http://0.0.0.0:3000, but I got an error message. In the first
case, I get: Connection refused. For the second one, there was an error
about no DNS entry?
Help!

--
Posted via http://www.ruby-forum.com/.

Walter Lee Davis

unread,
Mar 3, 2011, 12:11:06 PM3/3/11
to rubyonra...@googlegroups.com

On Mar 3, 2011, at 12:06 PM, Gaba Luschi wrote:

> Hi,
> After typing "rails server",

Please paste in what you see in Terminal after you typed this. You
might also see some sort of traffic log from the first try (the one
that was refused). Also, what does your /etc/hosts file look like? Do
you have the Firewall up? (not sure that matters on localhost, but
worth a try)

Walter

> I tried to go to http://localhost:3000, as
> well as http://0.0.0.0:3000, but I got an error message. In the first
> case, I get: Connection refused. For the second one, there was an
> error
> about no DNS entry?
> Help!
>
> --
> Posted via http://www.ruby-forum.com/.
>

> --
> You received this message because you are subscribed to the Google
> Groups "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-
> ta...@googlegroups.com.
> To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com
> .
> For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
> .
>

Gaba Luschi

unread,
Mar 3, 2011, 12:21:55 PM3/3/11
to rubyonra...@googlegroups.com
Walter,
This is what I get when I type in "rails server"

=> Booting WEBrick
=> Rails 3.0.4 application starting in development on
http://0.0.0.0:3000
=> call with -d to detach
=> Ctrl-C to shutdown server

[2011-03-03 12:20:42] INFO WEBrick 1.3.1
[2011-03-03 12:20:42] INFO ruby 1.8.7 (2011-02-18) [i386-mingw32]
[2011-03-03 12:20:42] INFO WEBrick::HTTPServer#start: pid = 1604 port
=3000

Gaba Luschi

unread,
Mar 3, 2011, 12:22:55 PM3/3/11
to rubyonra...@googlegroups.com
How do i check to see what my etc/hosts file look like? It's in a demo
app, in views, with a basic index.html. How do I check re: firewall?
Thanks!

Walter Lee Davis

unread,
Mar 3, 2011, 12:52:52 PM3/3/11
to rubyonra...@googlegroups.com

On Mar 3, 2011, at 12:22 PM, Gaba Luschi wrote:

> How do i check to see what my etc/hosts file look like? It's in a
> demo
> app, in views, with a basic index.html. How do I check re: firewall?
> Thanks!

If you're using a Mac, and TextMate, type mate /etc/hosts in your
Terminal. If you don't have TextMate, you can use your favorite
command-line editor through the generic (alias) command edit, as in
edit /etc/hosts. Or nano /etc/hosts for that very easy-to-use editor.

Again, on the Mac, the firewall is configured in the System
Preferences app, in the Security section.

On other platforms, I can't say for sure about either of these. On
anything Unix-like, edit /etc/hosts should get you **something**.

Walter

>
> --
> Posted via http://www.ruby-forum.com/.
>

Gaba Luschi

unread,
Mar 3, 2011, 1:10:11 PM3/3/11
to rubyonra...@googlegroups.com
I have windows. When I type in "edit /etc/hosts", I get
MS-DOS Editor
Version 2.0.026
Copyright (c) Microsoft Corp 1995

Is there something in particular I should look for here? I get
/B - Forces monochrome mode
/H - Displays the maximum number of lines possible for your hardware
.
.
.

Hassan Schroeder

unread,
Mar 3, 2011, 1:18:35 PM3/3/11
to rubyonra...@googlegroups.com
On Thu, Mar 3, 2011 at 9:52 AM, Walter Lee Davis <wa...@wdstudio.com> wrote:
>
> On other platforms, I can't say for sure about either of these.

[2011-03-03 12:20:42] INFO ruby 1.8.7 (2011-02-18) [i386-mingw32]

Doesn't the last part of that line indicate Windows?

--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
twitter: @hassan

Gaba Luschi

unread,
Mar 3, 2011, 1:22:42 PM3/3/11
to rubyonra...@googlegroups.com
So...how can I get http://localhost:3000 to display? Or connect to the
host, given that it seems like when I type "rails server" i get the
standard booting webrick messages...?

Frederick Cheung

unread,
Mar 3, 2011, 1:54:30 PM3/3/11
to rubyonra...@googlegroups.com, rubyonra...@googlegroups.com

On 3 Mar 2011, at 18:22, Gaba Luschi <li...@ruby-forum.com> wrote:

> So...how can I get http://localhost:3000 to display? Or connect to the
> host, given that it seems like when I type "rails server" i get the
> standard booting webrick messages...?

Did you check the windows firewall (or any other firewall you may have installed)? Worth tryin 127.0.0.1:3000 as well, I've occasionally had localhost resolve to an ipv6 address somehow

Fred


>
> --
> Posted via http://www.ruby-forum.com/.
>

> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.

> To post to this group, send email to rubyonra...@googlegroups.com.

Rodrigo Alves Vieira

unread,
Mar 3, 2011, 2:12:21 PM3/3/11
to rubyonra...@googlegroups.com

Gaba Luschi

unread,
Mar 3, 2011, 2:27:15 PM3/3/11
to rubyonra...@googlegroups.com
mmmh, both failed...thoughts?

Gaba Luschi

unread,
Mar 3, 2011, 2:34:47 PM3/3/11
to rubyonra...@googlegroups.com
Sorry, that is, the error is still "Connection refused."

Bryan Crossland

unread,
Mar 4, 2011, 12:03:43 PM3/4/11
to rubyonra...@googlegroups.com
On Thu, Mar 3, 2011 at 12:10 PM, Gaba Luschi <li...@ruby-forum.com> wrote:
I have windows.  When I type in "edit /etc/hosts", I get
MS-DOS Editor
Version 2.0.026
Copyright (c) Microsoft Corp 1995

Is there something in particular I should look for here?  I get
/B - Forces monochrome mode
/H - Displays the maximum number of lines possible for your hardware

On Windows XP your hosts file is located at C:\Windows\system32\drivers\etc\hosts. Run the following and let us know what is in it.

edit C:\Windows\system32\drivers\etc\hosts

B.

Gaba Luschi

unread,
Mar 4, 2011, 12:18:18 PM3/4/11
to rubyonra...@googlegroups.com
# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host

127.0.0.1 localhost

That's what I get.

thanks!

Bryan Crossland

unread,
Mar 4, 2011, 12:22:10 PM3/4/11
to rubyonra...@googlegroups.com


This is good. Next thing is to turn off your Windows Firewall. It's under Control Panel->Windows Firewall.

B.



That's what I get.

thanks!

Gaba Luschi

unread,
Mar 4, 2011, 12:52:42 PM3/4/11
to rubyonra...@googlegroups.com
Turn if off completely? Done. Still not working :(

Frederick Cheung

unread,
Mar 4, 2011, 2:38:16 PM3/4/11
to rubyonra...@googlegroups.com, rubyonra...@googlegroups.com
Any other 3rd party firewall software ?

Sent from my iPhone

Bryan Crossland

unread,
Mar 4, 2011, 3:08:31 PM3/4/11
to rubyonra...@googlegroups.com
On Fri, Mar 4, 2011 at 1:38 PM, Frederick Cheung <frederic...@gmail.com> wrote:
Any other 3rd party firewall software ?


By 3rd party Fred means Norton, McAfee, etc.

B.

Gaba Luschi

unread,
Mar 4, 2011, 3:46:01 PM3/4/11
to rubyonra...@googlegroups.com
Mmh, how can I check?

Bryan Crossland

unread,
Mar 4, 2011, 5:46:11 PM3/4/11
to rubyonra...@googlegroups.com
On Fri, Mar 4, 2011 at 2:46 PM, Gaba Luschi <li...@ruby-forum.com> wrote:
Mmh, how can I check?


Look in your system tray for it. You can also check your Add & remove Programs list.

Bill Fulbright

unread,
Sep 14, 2015, 8:21:30 AM9/14/15
to rubyonra...@googlegroups.com
I am building my environment on my Mac / Yosemite

Here is my /etc/hosts file

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost

I have installed Ruby, Ruby on Rails, mysql2, homebrew, gems (bundled),
built the newapp, run all the updates. Tried: localhost, 127.0.0.1,
ports 3000, 4000, 4040, 5000, 5050

I don't get it. What is the issue with connecting to the rails server?

If there is a concise answer to resolve this issue, I have not found it
yet.

Thanks,

bfulbright

Hassan Schroeder

unread,
Sep 14, 2015, 10:20:36 AM9/14/15
to rubyonrails-talk
On Mon, Sep 14, 2015 at 5:20 AM, Bill Fulbright <li...@ruby-forum.com> wrote:

> I don't get it. What is the issue with connecting to the rails server?

What server are you using, and how are you trying to start it?

If it fails to start there should be some kind of error message.

--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
http://about.me/hassanschroeder
twitter: @hassan
Consulting Availability : Silicon Valley or remote
Reply all
Reply to author
Forward
0 new messages