我可以使用rails s puma
或只是在rails中运行puma服务器puma
.
根据这个答案,运行rails s puma
使服务器知道rails环境.它显示puma
单独运行的服务器错误等.
我想像这样设置一个配置文件:
配置/ puma.rb
workers Integer(ENV['PUMA_WORKERS'] || 3)
threads Integer(ENV['MIN_THREADS'] || 1), Integer(ENV['MAX_THREADS'] || 16)
rackup DefaultRackup
port ENV['PORT'] || 3000
environment ENV['RACK_ENV'] || 'development'
...
Run Code Online (Sandbox Code Playgroud)
如果我运行puma -C config/puma.rb
一切正常.但是,如果我跑,rails s puma
我无法解决如何给彪马选项.我尝试过以下方法:
rails s puma # Puma server works but no config file is passed in.
rails s puma -C config/puma.rb # Invalid option -C
rails s puma -c config/puma.rb # Undefined …
Run Code Online (Sandbox Code Playgroud)