簡體   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

我嘗試啟動我的 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)

根據 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