Run rails in background - windows

I created one desktop browser app on rails installer on windows machine. Now I am trying to run rails s -p3001 -e production -d

. It doesn't work on PC.

How to detach application server process on Windows PC?

Here is the error

=> Booting Thin
 > Rails 3.2.7 application starting in production on http://0.0.0.0:3000
C:/ibt/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.7/lib
/active_support/core_ext/process/daemon.rb:3:in `fork': fork() function is unimp
lemented on this machine (NotImplementedError)
    from C:/ibt/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupp
 ort-3.2.7/lib/active_support/core_ext/process/daemon.rb:3:in `daemon'
    from C:/ibt/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.4.1
/lib/rack/server.rb:314:in `daemonize_app'
    from C:/ibt/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.4.1
 /lib/rack/server.rb:254:in `start'
    from C:/ibt/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3
.2.7/lib/rails/commands/server.rb:70:in `start'
from C:/ibt/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3
2.7/lib/rails/commands.rb:55:in `block in <top (required)>'
    from C:/ibt/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3
2.7/lib/rails/commands.rb:50:in `tap'
    from C:/ibt/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3
.2.7/lib/rails/commands.rb:50:in `<top (required)>'
     from script/rails:6:in `require'
     from script/rails:6:in `<main>'

      

+3


source to share


2 answers


I resolved this question by referencing link :: run rails in background process -windows



Thanks for the replies Murthy

0


source


Error message makes it very clear fork() function is unimp lemented on this machine (NotImplementedError)

.

Implemented the rail server process by calling fork system call

on the machine. Here is the relevant code from the rails repo:exit if fork



It doesn't work on Windows PC because it Windows Operating System

doesn't make a system call fork

.

One option might be to install Cygwin

on a Windows PC, as suggested in this answer to "What's the closest thing to windows for fork ()?"

+1


source







All Articles