简体   繁体   English

Rails 5.1.4 未启动并给我错误:JRuby 或 Windows 不支持工作模式退出

[英]Rails 5.1.4 not starting and giving me ERROR: worker mode not supported on JRuby or Windows Exiting

I tried starting my rails server but got the error message below, how can i fix it please我尝试启动我的 Rails 服务器,但收到以下错误消息,请问我该如何解决

C:\Sites\sample_app>rails s
=> Booting Puma
=> Rails 5.1.4 application starting in development
=> Run `rails server -h` for more startup options
  Please add the following to your Gemfile to avoid polling for changes:
    gem 'wdm', '>= 0.1.0' if Gem.win_platform?
  Please add the following to your Gemfile to avoid polling for changes:
    gem 'wdm', '>= 0.1.0' if Gem.win_platform?
ERROR: worker mode not supported on JRuby or Windows
Exiting

根据 Puma的问题页面,可以通过注释掉puma.rb的以下行来解决问题:

workers Integer(ENV['WEB_CONCURRENCY'] || 2)

According to the same issue page for Puma, for the newer versions of rails, it can be resolved by commenting out the following line in puma.rb :根据 Puma 的同一问题页面,对于较新版本的 rails,可以通过在puma.rb中注释掉以下行来解决:

# workers ENV.fetch("WEB_CONCURRENCY") { 4 }
# workers ENV.fetch("WEB_CONCURRENCY") { 2 }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM