gpt4 book ai didi

ruby-on-rails - 无法 ping http ://localhost:3000 with Rails

转载 作者:行者123 更新时间:2023-12-04 06:02:58 25 4
gpt4 key购买 nike

我无法 ping http://localhost:3000从我的终端运行 Webrick。但是,在网络浏览器上加载它时,我得到默认的“欢迎出国”页面。我将 Rails 用作移动应用程序的后端服务 - 因此我需要以这种方式访问​​ API。

>ping http://localhost:3000/
ping: cannot resolve http://localhost:3000/: Unknown host
>ping http://127.0.0.1
ping: cannot resolve http://127.0.0.1: Unknown host
>ping http://127.0.0.1:3000
ping: cannot resolve http://127.0.0.1:3000: Unknown host

最佳答案

ping 命令发送 ICMP 数据包并且不知道 URL 是什么,它 pre-dates the web by about ten years .它需要一个主机名,例如:

ping localhost

您想要的是使用像 curlwget 这样的网络工具来访问您的页面:

curl http://localhost:3000/

关于ruby-on-rails - 无法 ping http ://localhost:3000 with Rails,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31036657/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com