无法在Debian上打开localhost

时间:2014-03-31 11:58:39

标签: ruby-on-rails ruby webrick

我已经开始学习Ruby on rails但我无法在Chrome浏览器中打开localhost:30000.0.0.0:3000127.0.0.1:3000

=> Booting WEBrick
=> Rails 4.0.4 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2014-03-31 14:40:49] INFO  WEBrick 1.3.1
[2014-03-31 14:40:49] INFO  ruby 2.1.0 (2013-12-25) [x86_64-linux]
[2014-03-31 14:40:49] INFO  WEBrick::HTTPServer#start: pid=23204 port=3000

的/ etc /主机

127.0.0.1   localhost
127.0.1.1   Hexbook.Dlink   Hexbook

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
127.0.0.1 smxi.org
http://smxi.org smxi.org
209.197.72.47 smxi.org

在浏览器错误ERR_INVALID_ARGUMENT

和卷曲:

root@Hexbook:/home/hexxy# curl 127.0.0.1:3000
curl: (7) couldn't connect to host

问题解决了:

ifconfig lo 127.0.0.1 up

1 个答案:

答案 0 :(得分:0)

其他应用程序很可能正在使用该端口。

你可以尝试找出它是哪一个,或者你可以尝试使用另一个端口,通常是通过一些-p或类似的开关。