Running Webrick Server in Background

Running Webrick server in background?

The Output is already giving you the answer:

=> Call with -d to detach

Ruby on Rails: How to start the WEBrick server automatically on Windows in background?

The simpler way is to create a batch file with the instruction what you give in the command prompt like

d:

cd projects\myapp

ruby script\server

and then drop a copy of the file to Windows Start -> All Programs -> start up folder.

Start ruby/rail server in background

Found the answer !

simply add the tag -d to start it as a deamon...

bundle exec ruby bin/rails server -d -b 192.168.0.8 webrick -e production

Run WEBrick as a Windows service

I have never seen WEBrick used in Windows services but a workaround could be running the web server as a background job. This is how you would do it:

You'll need a bat file with the 2 instructions to start the web server:

  • cd to_your_absolute_app_path
  • rails s

Then you'll need to convert that bat file to an exe file. Check this for a free tool. I know the tool exists for 32 and 64 bits, you might need to look around for the right one.

When you create the exe make sure to select it to run as an invisible app.

Then you put the exe in the start up folder. That should do it.



Related Topics



Leave a reply



Submit