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
How to Create a Symbol from a String That Has Whitespaces
How to Write a Rails Mixin That Spans Across Model, Controller, and View
How to Set a Cookie with a (Ruby) Rack Middleware Component
How to Store Enum as String to Database in Rails
How to Detect User Agent in Rails 3.1
Deleting the Current Session with Rack::Session::Cookie
Comma Separated Array with a Text_Field in Rails
Rails Nested With_Option :If Used in Validation
Limiting Characters/Words in View - Ruby on Rails
Rails Activerecord Query Date Range
Does Begin . . . End While Denote a 'Block'
Iterate Over Days, Starting from X Date Through an End Date
Single Occurrence Event with Ice_Cube Gem Using Start_Time and End_Time
Using Activerecord Interface for Models Backed by External API in Ruby on Rails