简体   繁体   中英

Sinatra: Shotgun/Rerun having trouble starting sometimes?

I'm not sure if it's something I added in my code recently, but when I try and use Shotgun or Rerun to run my server, it will sometimes hang before it actually says the "Listening on 0.0.0.0" line in Terminal.

I haven't seen this occur when I run my Sinatra server directly with ruby.

There's no errors popping up anywhere - it just seems to hang on starting or reloading after a save... happens about 20% of the time I'd say.

How can I figure out what is causing the issue? I would assume it's either A) something in my code, or B) something going on with my file system.

Why are you using rerun with shotgun ? shotgun auto reloads the connection on change.

If you're serving it with puma or something that doesn't refresh when you change the project, then rerun would be necessary.

If you're concerned with speed have a look at this: http://scorchedrb.com/docs/further_reading/code_reloading

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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