Skip to content

Commit

Permalink
Added config option for prune_bundler
Browse files Browse the repository at this point in the history
  • Loading branch information
behe committed Sep 30, 2014
1 parent 6945cc3 commit cddd274
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ Configurable options, shown here with defaults: Please note the configuration op
set :puma_worker_timeout, nil
set :puma_init_active_record, false
set :puma_preload_app, true
set :puma_prune_bundler, false
```
For Jungle tasks (beta), these options exist:
```ruby
Expand Down
1 change: 1 addition & 0 deletions lib/capistrano/tasks/puma.cap
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ namespace :load do
set :puma_error_log, -> { File.join(shared_path, 'log', 'puma_error.log') }
set :puma_init_active_record, false
set :puma_preload_app, true
set :puma_prune_bundler, false

This comment has been minimized.

Copy link
@crhan

crhan Mar 3, 2015

Collaborator

why this option default to false? it cause my new deploying puma crash again!

referencing former issue: #19

This comment has been minimized.

Copy link
@behe

behe Mar 3, 2015

Author Contributor

Because it is incompatible with preload_app which is enabled by default: https://github.com/puma/puma/blob/master/examples/config.rb#L132

This comment has been minimized.

Copy link
@crhan

crhan Mar 3, 2015

Collaborator

don't you have the problem issued by #19 ?

This comment has been minimized.

Copy link
@behe

behe Mar 3, 2015

Author Contributor

No, change your defaults in config/deploy.rb to:

set :puma_preload_app, false
set :puma_prune_bundler, true

# Rbenv and RVM integration
set :rbenv_map_bins, fetch(:rbenv_map_bins).to_a.concat(%w{ puma pumactl })
Expand Down
7 changes: 3 additions & 4 deletions lib/capistrano/templates/puma.rb.erb
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@ worker_timeout <%= fetch(:puma_worker_timeout).to_i %>
preload_app!
<% end %>
on_restart do
puts 'Refreshing Gemfile'
ENV["BUNDLE_GEMFILE"] = "<%= fetch(:bundle_gemfile, "#{current_path}/Gemfile") %>"
end
<% if fetch(:puma_prune_bundler) %>
prune_bundler
<% end %>
<% if fetch(:puma_init_active_record) %>
on_worker_boot do
Expand Down

0 comments on commit cddd274

Please sign in to comment.