我计划在Linux上部署一个Rails 5应用程序,但由于我们需要一些非常特定的Windows专用软件,所以我需要在Windows 2012 R2上部署它。我的软件栈(或者混合)应该是Nginx/Puma/Rails/PostgreSQL/Redis。除了Puma之外,所有东西都在Windows上为我安装,Rails文档说我需要用于ActionCable的Puma。
如何让Puma在Windows上运行?我已经看到并尝试过一些要尝试的事情,我也看到并尝试了一些不应该做的事情,比如在守护进程模式下运行,因为不支持叉子()。有没有人有一组关于如何让Puma在Windows上使用Rails应用程序的可重复指令?
或者,如果Puma不适合Windows,那么是否有一个可重复的替代方案来将带有ActionCable的Rails 5应用程序部署到Windows主机(例如Windows2012 R2)?
发布于 2016-08-15 17:15:34
根据来自github页面的自述文件,需要记住以下几点:
下面是puma.rb文件的样子:
worker 0 # Not necessary. The default is "0"
threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }.to_i
threads threads_count, threads_count
bind "tcp://127.0.0.1:4001" # Not necessary. Default is "tcp://0.0.0.0:9292"
environment ENV.fetch("RAILS_ENV") { "development" }
plugin :tmp_restart最后,运行bundle exec puma -C config\puma.rb,它应该可以工作。
https://stackoverflow.com/questions/38921292
复制相似问题