Skip to content
This repository has been archived by the owner on Dec 31, 2022. It is now read-only.

Commit

Permalink
fix: failed to start appserver. (#146)
Browse files Browse the repository at this point in the history
ex)
$ /srv/www/rails/shared/scripts/puma.service start
Set Puma process UID to 5000
Starting Puma rails
cd /srv/www/rails/current && /usr/local/bin/bundle exec puma -C #{ROOT_PATH}/shared/config/puma.rb
/srv/www/rails/shared/vendor/bundle/ruby/2.4.0/gems/puma-3.10.0/lib/puma/cli.rb:47:in `initialize': missing argument: -C (OptionParser::MissingArgument)
	from /srv/www/rails/shared/vendor/bundle/ruby/2.4.0/gems/puma-3.10.0/bin/puma:8:in `new'
	from /srv/www/rails/shared/vendor/bundle/ruby/2.4.0/gems/puma-3.10.0/bin/puma:8:in `<top (required)>'
	from /srv/www/rails/shared/vendor/bundle/ruby/2.4.0/bin/puma:23:in `load'
	from /srv/www/rails/shared/vendor/bundle/ruby/2.4.0/bin/puma:23:in `<main>'
  • Loading branch information
ajgon authored Feb 25, 2018
1 parent 784d117 commit 4505890
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion libraries/drivers_appserver_puma.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def appserver_config
end

def appserver_command
'puma -C #\{ROOT_PATH\}/shared/config/puma.rb'
'puma -C #{ROOT_PATH}/shared/config/puma.rb' # rubocop:disable Lint/InterpolationCheck
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion libraries/drivers_appserver_thin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def appserver_config
end

def appserver_command
'thin -C #\{ROOT_PATH\}/shared/config/thin.yml'
'thin -C #{ROOT_PATH}/shared/config/thin.yml' # rubocop:disable Lint/InterpolationCheck
end
end
end
Expand Down
4 changes: 3 additions & 1 deletion libraries/drivers_appserver_unicorn.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ def appserver_config
end

def appserver_command
'unicorn_rails --env #\{DEPLOY_ENV\} --daemonize -c #\{ROOT_PATH\}/shared/config/unicorn.conf'
# rubocop:disable Lint/InterpolationCheck
'unicorn_rails --env #{DEPLOY_ENV} --daemonize -c #{ROOT_PATH}/shared/config/unicorn.conf'
# rubocop:enable Lint/InterpolationCheck
end
end
end
Expand Down
12 changes: 9 additions & 3 deletions spec/unit/recipes/configure_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,11 @@
expect(chef_run)
.to render_file("/srv/www/#{aws_opsworks_app['shortname']}/shared/scripts/unicorn.service")
.with_content('DEPLOY_ENV="staging"')
# rubocop:disable Lint/InterpolationCheck
expect(chef_run)
.to render_file("/srv/www/#{aws_opsworks_app['shortname']}/shared/scripts/unicorn.service")
.with_content('unicorn_rails --env #\{DEPLOY_ENV\} --daemonize -c #\{ROOT_PATH\}/shared/config/unicorn.conf')
.with_content('unicorn_rails --env #{DEPLOY_ENV} --daemonize -c #{ROOT_PATH}/shared/config/unicorn.conf')
# rubocop:enable Lint/InterpolationCheck
end

it 'defines unicorn service' do
Expand Down Expand Up @@ -563,9 +565,11 @@
expect(chef_run)
.to render_file("/srv/www/#{aws_opsworks_app['shortname']}/shared/scripts/puma.service")
.with_content('DEPLOY_ENV="staging"')
# rubocop:disable Lint/InterpolationCheck
expect(chef_run)
.to render_file("/srv/www/#{aws_opsworks_app['shortname']}/shared/scripts/puma.service")
.with_content('puma -C #\{ROOT_PATH\}/shared/config/puma.rb')
.with_content('puma -C #{ROOT_PATH}/shared/config/puma.rb')
# rubocop:enable Lint/InterpolationCheck
end

it 'defines puma service' do
Expand Down Expand Up @@ -977,9 +981,11 @@
expect(chef_run)
.to render_file("/srv/www/#{aws_opsworks_app['shortname']}/shared/scripts/thin.service")
.with_content('DEPLOY_ENV="staging"')
# rubocop:disable Lint/InterpolationCheck
expect(chef_run)
.to render_file("/srv/www/#{aws_opsworks_app['shortname']}/shared/scripts/thin.service")
.with_content('thin -C #\{ROOT_PATH\}/shared/config/thin.yml')
.with_content('thin -C #{ROOT_PATH}/shared/config/thin.yml')
# rubocop:enable Lint/InterpolationCheck
end

it 'defines thin service' do
Expand Down

0 comments on commit 4505890

Please sign in to comment.