title: Cannot connect to Localhost:3000 for Rails but 127.0.0.1:3000 works
body: <p>I am learning Ruby on Rails with railstutorial.org and met this strange problem.</p>
  
  <p>I ran "rails server" and the following information showed:</p>
  
  <pre><code>=&gt; Booting WEBrick
  =&gt; Rails 4.0.4 application starting in development on http://0.0.0.0:3000
  =&gt; Run `rails server -h` for more startup options
  =&gt; Ctrl-C to shutdown server
  [2014-04-02 01:28:18] INFO  WEBrick 1.3.1
  [2014-04-02 01:28:18] INFO  ruby 2.0.0 (2014-02-24) [x86_64-darwin12.5.0]
  [2014-04-02 01:28:18] INFO  WEBrick::HTTPServer#start: pid=13004 port=3000
  </code></pre>
  
  <p>I try connecting to localhost:3000 on various browsers and they all cannot establish a connection to the server.</p>
  
  <p>I also tried rails server -p 3001 and connect to localhost:3001, which failed as well.</p>
  
  <p>However, I tried 0.0.0.0:3000 , 127.0.0.1:3000, both of them worked and rendered the default welcome for rails.</p>
  
  <p>Then I tried localhost:80, which successfully told me "It Works" and I can actually connect to my another local project using PHP+Apache.</p>
  
  <p>So I really wonder why this happens and could anyone possibly give me any hint on it.</p>
  
  <p>Thank you in advance:)</p>