我只是想在本地运行服务器。我在Windows上,在Windows上使用Ruby on Rails是很痛苦的,所以我在使用Vagrant。我正在从Vagrant Shell中执行所有这些命令。
我试过rails s
和rails s -b 0.0.0.0
。两者都在终端机给了我好的答复:
=> Rails 5.2.3 application starting in development
=> Run `rails server -h` for more startup options
Puma starting in single mode...
* Version 3.12.1 (ruby 2.6.1-p33), codename: Llamas in Pajamas
* Min threads: 5, max threads: 5
* Environment: development
但是,当我localhost:3000
在浏览器中转到时,它会给我:
This site can't be reached.
localhost refused to connect.
当我尝试curl http://localhost:3000
获得:
curl: (7) Failed to connect to localhost port 3000: Connection refused
我的Vagrantfile中也有以下代码行:
config.vm.network "forwarded_port", guest: 3000, host: 3000
真的不知道下一步该怎么做。现在,我正在安装Ubuntu ISO文件(将在5个小时内完成,因此需要很多时间),以创建VirtualBox实例作为备份,如果这样做不起作用。希望我能找到解决办法。
通过在UBUNTU VirtualBox计算机上运行Ruby on Rails来解决。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句