Error attempting to launch Unicorn in Rails

Asked 1 years ago, Updated 1 years ago, 108 views

Prerequisites/What you want to achieve

I would like to deploy with the ec2-user of AWS.
It used to be ready, but suddenly I can't deploy it.
I want to be able to deploy.

Problems/Error Messages you are experiencing

Error on terminal screen.

$RAILS_SERVE_STATIC_FILES=1 unicorn_rails-c config/unicorn.rb-E production-D
Traceback (most recent call last):
    10:from/home/ec2-user/.rbenv/versions/2.5.1/bin/unicorn_rails:23:in`<main>'
     9:from/home/ec2-user/.rbenv/versions/2.5.1/bin/unicorn_rails:23:in `load'
     8:from/home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/unicorn-5.4.1/bin/unicorn_rails:209:in`<top(required)>'
     7:from/home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/unicorn-5.4.1/bin/unicorn_rails:209:in`new'
     6:from/home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/unicorn-5.4.1/lib/unicorn/http_server.rb:77:in `initialize'
     5:from/home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/unicorn-5.4.1/lib/unicorn/http_server.rb:77:in`new'
     4:from/home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/unicorn-5.4.1/lib/unicorn/configurator.rb:77:in `initialize'
     3:from/home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/unicorn-5.4.1/lib/unicorn/configurator.rb:84:in`reload'
     2:from/home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/unicorn-5.4.1/lib/unicorn/configurator.rb:84:in`instance_eval'
     1:from config/unicorn.rb:5:in`reload'
/home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/unicorn-5.4.1/lib/unicorn/configurator.rb:592:in`working_directory':config_file=config/unicorn.rbould be working/wwwwworry/wwwwworry/wwwwworry/wwwwwwwwwwworry
master failed to start, check stderr log for details

The code described in Users/kanexxshxx/projects_2020/post_app/config/unicorn.rb

app_path=File.expand_path('../../../',__FILE__)

worker_processes1

working_directory "#{app_path}/current"

listen "#{app_path}/shared/tmp/sockets/unicorn.sock"
pid "#{app_path}/shared/tmp/pids/unicorn.pid"
stderr_path "#{app_path}/shared/log/unicorn.stderr.log"
stdout_path "#{app_path}/shared/log/unicorn.stdout.log"

timeout 60

GEMFILE Code Summary

ruby '2.5.1'
gem 'rails', '~>5.2.4', '>=5.2.4.2'
gem 'mysql2', '>=0.4.4', '<0.6.0'
gem 'puma', '~>3.11'
gem'sass-rails', '~>5.0'
gem 'uglifer', '>=1.3.0'
gem 'coffee-rails', '~>4.2'
gem'turbolinks', '~>5'
gem 'bootsnap', '>=1.1.0', require: false

group:development,:test do
  # Call'byebug'anywhere in the code to stop execution and get a debugger console
  gem 'byebug', platforms: [:mri,:mingw,:x64_mingw]
  gem 'capistrano'
  gem 'capistrano-rbenv'
  gem 'capistrano-bundler'
  gem 'capistrano-rails'
  gem'capistrano3-unicorn'
end

group —Development do
  gem 'web-console', '>=3.3.0'
  gem 'listen', '>=3.0.5', '<3.2'
  gem 'spring'
  gem's spring-watcher-listen', '~>2.0.0'
  gem 'brakeman', require: false
end

group —test do
  gem 'capybara', '>=2.15'
  gem'selenium-webdriver'
  gem 'chromedriver-helper'
end

group —Production do
  gem 'unicorn', '5.4.1'
end

gem'tzinfo-data', platforms: [:mingw,:mswin,:x64_mingw,:jruby]
gem'kaminari'
gem 'devise'
gem 'font-awesome-rails'
gem'rspec-rails'
gem 'device-i18n'

Tried

Terminal

$sudo town-Rec2-user:ec2-user/var/www/post_app/tmp

Then

$RAILS_SERVE_STATIC_FILES=1 unicorn_rails-c config/unicorn.rb-E production-D

The error was the same when you ran .

I would like to solve this problem, so please take care of it.

ruby-on-rails ruby aws unicorn capistrano

2022-09-30 19:44

1 Answers

/home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/unicorn-5.4.1/lib/unicorn/configurator.rb:592:in`working_directory':config_file=config/unicornicorn/workable_work=inocory
master failed to start, check stderr log for details

As it says,

config_file=config/unicorn.rb 

Also check for /var/www/current/config/unicorn.rb.


2022-09-30 19:44

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.