简体   繁体   English

Ruby / Sinatra / jQuery应用未在repl.it中运行

[英]Ruby/Sinatra/jQuery app not running in repl.it

My mad libs game (Ruby/Sinatra backend, most logic is JS/jQuery, data is stored in json files) runs fine on my Mac and my Ubuntu VirtualBox, but when I installed it on repl.it (and made a few changes that seemed indicated by their example script). 我的疯狂libs游戏 (Ruby / Sinatra后端,大多数逻辑是JS / jQuery,数据存储在json文件中)在Mac和Ubuntu VirtualBox上运行良好,但是当我将其安装在repl.it上时(进行了一些更改)似乎由其示例脚本指示)。

When I "start" the script on repl.it, here , I get the following error message at the location where it's supposed to show up : 当我在repl.it上 “启动”脚本时,在 应该显示的位置会收到以下错误消息:

Unable To Wake Up 无法唤醒

30 seconds.Your repl did't wake up in time. 30秒。您的代表没有及时醒来。 Please try again in 30 seconds. 请在30秒后重试。

I've never been able to run it even once on repl.it. 我什至无法在repl.it上运行一次。 Any ideas about why not? 关于为什么不的任何想法? I'm totally new to repl.it and I can't find any help files. 我对repl.it完全陌生,找不到任何帮助文件。 It seems to be a new service. 这似乎是一项新服务。

TIA. TIA。

You need to add 您需要添加

set :bind, '0.0.0.0'

You can see https://repl.it/languages/sinatra for an example. 您可以查看https://repl.it/languages/sinatra作为示例。

This is something you frequently need to do when running web servers on remote machines, since they forward requests from the public internet to this IP address. 这是在远程计算机上运行Web服务器时经常需要执行的操作,因为它们会将来自公共Internet的请求转发到此IP地址。

I forked this and made the change, and although there was another error (can't find main.erb), it at least solves the issue this question is about. 我对此进行了分叉并进行了更改,尽管还有另一个错误(找不到main.erb),但它至少解决了此问题所要解决的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM