3

我在 windows pc 上的 rails 安装程序上创建了一个桌面浏览器应用程序。现在我正在尝试运行rails s -p3001 -e production -d。它不在电脑上运行。

如何分离windows pc上的应用程序服务器进程?

这是错误

=> 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>'
4

2 回答 2

1

错误信息说得很清楚:fork() function is unimp lemented on this machine (NotImplementedError).

rails server 被守护的方式是通过调用fork system call机器上的。这是来自 rails repo 的相关代码:exit if fork

它在 Windows pc 上失败,因为Windows Operating System没有实现fork系统调用。

一种选择可能是安装Cygwin在 windows pc 上,如windows has to fork() 的最接近的东西是什么的答案中所建议的那样?

于 2013-02-07T10:10:59.970 回答
0

I have solved this question with reference of the link :: run rails in background process -windows

Thanks for the answers Murthy

于 2013-02-12T09:52:57.317 回答