Rails服务器正在运行,但无法连接/ ping / telnet到localhost

我正在研究ubuntu 15.04(它不是VM)。 我安装了rails,ruby和bundler。 当我启动服务器时,一切似乎工作正常,因为我得到了这个:

sudo rails s -p 8080 Warning: Running `gem pristine --all` to regenerate your installed gemspecs (and deleting then reinstalling your bundle if you use bundle --path) will improve the startup performance of Spring. => Booting WEBrick => Rails 4.2.5.2 application starting in development on http://localhost:8080 => Run `rails server -h` for more startup options => Ctrl-C to shutdown server [2016-03-31 22:38:50] INFO WEBrick 1.3.1 [2016-03-31 22:38:50] INFO ruby 2.1.2 (2014-05-08) [x86_64-linux-gnu] [2016-03-31 22:38:50] INFO WEBrick::HTTPServer#start: pid=10415 port=8080 

当我尝试在我的网络浏览器中访问我的本地主机时,我得到“连接失败”。 所以我试着ping我的本地主机,我得到了:

 $ ping localhost:8080 ping: unknown host localhost:8080 

我也试过telnet:

 $ telnet localhost 8080 Trying 127.0.0.1... telnet: Unable to connect to remote host: Connection refused 

在查看主机名映射时,我得到了:

 $ cat /etc/hosts 127.0.0.1 localhost 127.0.1.1 alex-VPCFXXXXX 

看到之后,一切似乎都很正常……所以我真的不明白为什么它不起作用,为什么我不能在这个端口上ping / telnet我的localhost(我尝试使用3000或3001只是为了确保.. 。)

希望你能帮助我这个:)