Skip to content

Commit 40a55b2

Browse files
committed
Convert to Puma from unicorn
It's a copy / paste from a newly generated project with react_on_rails
1 parent a488445 commit 40a55b2

File tree

5 files changed

+19
-33
lines changed

5 files changed

+19
-33
lines changed

Gemfile

+1-3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ group :production do
1212
# Pg is used for Heroku
1313
gem "pg"
1414
gem "rails_12factor" # Never include this for development or tests
15+
gem "puma"
1516
end
1617

1718
# Use SCSS for stylesheets
@@ -37,9 +38,6 @@ gem "sdoc", group: :doc
3738
# Use Rails Html Sanitizer for HTML sanitization
3839
gem "rails-html-sanitizer"
3940

40-
# Use Unicorn as the app server
41-
gem "unicorn"
42-
4341
gem "react_on_rails"
4442

4543
# See https://github.com/sstephenson/execjs#readme for more supported runtimes

Gemfile.lock

+2-7
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ GEM
130130
activesupport (>= 3.0.0, < 5)
131131
multi_json (~> 1.2)
132132
json (1.8.3)
133-
kgio (2.10.0)
134133
launchy (2.4.3)
135134
addressable (~> 2.3)
136135
libv8 (3.16.14.13)
@@ -168,6 +167,7 @@ GEM
168167
pry-stack_explorer (0.4.9.2)
169168
binding_of_caller (>= 0.7)
170169
pry (>= 0.9.11)
170+
puma (2.15.3)
171171
rack (1.6.4)
172172
rack-test (0.6.3)
173173
rack (>= 1.0)
@@ -201,7 +201,6 @@ GEM
201201
rake (>= 0.8.7)
202202
thor (>= 0.18.1, < 2.0)
203203
rainbow (2.0.0)
204-
raindrops (0.15.0)
205204
rake (10.4.2)
206205
rdoc (4.2.0)
207206
react_on_rails (1.1.0)
@@ -307,10 +306,6 @@ GEM
307306
unf (0.1.4)
308307
unf_ext
309308
unf_ext (0.0.7.1)
310-
unicorn (5.0.1)
311-
kgio (~> 2.6)
312-
rack
313-
raindrops (~> 0.7)
314309
web-console (2.2.1)
315310
activemodel (>= 4.0)
316311
binding_of_caller (>= 0.7.2)
@@ -347,6 +342,7 @@ DEPENDENCIES
347342
pry-rails
348343
pry-rescue
349344
pry-stack_explorer
345+
puma
350346
rails (~> 4.2)
351347
rails-html-sanitizer
352348
rails_12factor
@@ -364,7 +360,6 @@ DEPENDENCIES
364360
therubyracer
365361
turbolinks
366362
uglifier
367-
unicorn
368363
web-console
369364

370365
BUNDLED WITH

Procfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb
1+
web: bundle exec puma -C config/puma.rb

config/puma.rb

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
workers Integer(ENV["WEB_CONCURRENCY"] || 2)
2+
threads_count = Integer(ENV["MAX_THREADS"] || 5)
3+
threads threads_count, threads_count
4+
5+
preload_app!
6+
7+
rackup DefaultRackup
8+
port ENV["PORT"] || 3000
9+
environment ENV["RACK_ENV"] || "development"
10+
11+
on_worker_boot do
12+
# Worker specific setup for Rails 4.1+
13+
# See: https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#on-worker-boot
14+
ActiveRecord::Base.establish_connection
15+
end

config/unicorn.rb

-22
This file was deleted.

0 commit comments

Comments
 (0)