如何将Rails dev服务器设置为webbrick而不是Puma [英] How to set Rails dev server to webbrick instead of Puma

查看:118
本文介绍了如何将Rails dev服务器设置为webbrick而不是Puma的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的服务器上使用Heroku上的Puma。当我安装Puma gem时,我的开发环境启动Puma作为服务器。如果不从我的gem文件中提取pum gem,我似乎无法关闭它。

我喜欢在开发中使用save服务器作为生产的想法,但puma服务器使我很难追踪我的调试语句。此外,我似乎没有办法改变最大线程,即使我的puma.rb文件将它设置为1,在开发中出现为16。

方案

在生产模式下使用puma。在您的gem文件中更改 gem'puma' with

  #Gemfile 
group:production do
gem'puma'
end

然后运行 bundle install --without production 来安装gem。


I'm using Puma on Heroku for my server. When i have the Puma gem installed my dev environment boots up with Puma as the server. I don't seem to be able to shut that off without pulling the pum gem from my gemfile.

I like the idea of using the save server in development as production but the puma server make it difficult to track my debug statements. Also i don't seem to have a way to change max threads, comes up as 16 in dev even though my puma.rb file sets it to 1.

解决方案

Just use puma in production mode. In your gemfile change gem 'puma' with

#Gemfile
group :production do
  gem 'puma'
end

and then run bundle install --without production to install the gem .

这篇关于如何将Rails dev服务器设置为webbrick而不是Puma的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆