An error related to Unicorn occurred during automatic deployment during portfolio creation. Regarding the content of the error, it was a simple content that the location of the file was wrong, but I neglected to check the log (Rather, I didn't understand how to check the log), it took time to resolve, so I would like to describe it including the command.
Ruby on Rails '6.0.0' Ruby '2.6.5'
Until now, automatic deployment by Capistrano was possible. After editing the application locally, as usual When I executed the deploy command like this, the following error appeared.
01:12 unicorn:start
(abridgement)
SSHKit::Command::Failed: bundle exit status: 1
bundle stdout: Nothing written
bundle stderr: master failed to start, check stderr log for details
(abridgement)
If you refer to the error statement, there is a description of ** check stderr log for details **, so check the log. I tried to do it, but I started by wondering how to check it, so I will describe it.
#Move to application directory
[ec2-user@ip-172-31-23-189~]$ cd /var/www/Application name
#Move to current directory
[ec2-user@ip-172-31-23-189 <Repository name>]$ cd current
#Go to log directory
[ec2-user@ip-172-31-23-189 current]$ cd log
#Display information of files contained in log
[ec2-user@ip-172-31-23-189 log]$ ls
production.log unicorn.stderr.log unicorn.stdout.log
tail -f unicorn.stderr.log
or
cat unicorn.stderr.log
tail -f: Display 10 lines of the latest log cat: Show all logs
This time, I first tried using "tail -f", but I don't know the cause. Therefore, I used the "cat" command to display all the logs. Then
(abridgement)
bundler: failed to load command: unicorn (/var/www/myapp/shared/bundle/ruby/2.6.0/bin/unicorn)
Zeitwerk::NameError: expected file /var/www/myapp/releases/20201226010858/app/controllers/users/users_controller.rb to define constant Users::UsersController, but didn't
I found the above error log! !! For the time being, I understand that there is a problem with uses_controller.rb. So I came up with a solution.
I realized again the importance of checking the logs. Even if you just copy and paste the error sentence and search Through this error, I realized that it could not be resolved. .. .. .. I will continue to study! !! !! !!
Recommended Posts