简体   繁体   中英

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

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 :

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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