[RUBY] What to do if the update does not take effect after deploying Rails AWS

Introduction

I think there are many people who have worked harder to deploy the apps they have created on AWS.

I also had a lot of trouble and succeeded in deploying on AWS.

···But!

How do you update this when you rewrite the code locally?

Of course ** Capistrano ** (I don't know anything because I haven't learned yet) It may be possible to deploy it automatically, but for the time being, I want to update it manually (?) Instead of automatically.

At first, I thought that it would be reflected if I logged in to EC2 and git pull in the repository of the app, but it was not updated.

The result of investigating

I looked it up, but I couldn't find the information I wanted, and I wonder if I'm the only one who has stopped for this. ?? ??

I was a little worried, but I wonder if this is somehow googled. I was able to find the information.

That was ** unicorn restart **.

Solution

$ ps -ef | grep unicorn | grep -v grep

Log in to EC2 and check the status of unicorn from the app repository.

hiroaki   6472     1  0 Aug26 ?        00:00:02 unicorn_rails master -c /var/www/rails/ride_on/config/unicorn.conf.rb -D -E production                                                                                          
hiroaki   7030  6472  0 Aug26 ?        00:00:10 unicorn_rails worker[1] -c /var/www/rails/ride_on/config/unicorn.conf.rb -D -E production                                                                                       
hiroaki   7051  6472  0 Aug26 ?        00:00:10 unicorn_rails worker[0] -c /var/www/rails/ride_on/config/unicorn.conf.rb -D -E production                                                                                       

If it is displayed like this, it is started, so Kill the unicorn master to stop it.

$ kill -9 6472

If you stop it, check it with this command, if there is no display, it is stopped

$ ps -ef | grep unicorn | grep -v grep

After that, start it with this command.

$ bundle exec unicorn_rails -c /var/www/rails/(app name)/config/unicorn.conf.rb -D -E production

When I checked it with this, the production environment was also updated properly ...!

I'm relieved that the update will be reflected for the time being, but I still don't understand AWS, so I'll study more ...

Recommended Posts

What to do if the update does not take effect after deploying Rails AWS
What to do if the background image is not applied after deployment
What to do if the Rails server can't start
What to do when rails db: seed does not reflect in the database
What to do if the rails server doesn't run out on AWS cloud9
What to do if you can't bundle update and bundle install after installing Ruby 3.0.0 in the Rails tutorial
What to do if you can't find your API key after deploying to Rails heroku
What to do if the JSONHint annotation does not work with lombok and JSONIC
What to do if the breakpoint is shaded and does not stop during debugging
What to do if you can't use the rails command
What to do if you installed Ruby with rbenv but the version does not change
What to do when Rails on Docker does not reflect controller changes in the browser
[Ubuntu 20.04] What to do if the external monitor is not recognized
What to do if validation doesn't work with the update action
[Rails] What to do if data is not registered in DB
What to do if the Rails page doesn't appear in Rails tutorial 1.3.2
What to do if Cloud9 is full in the Rails tutorial
[Rails] What to do when rails s does not respond or does not stop
[Note] What to do if bundle install in Chapter 3 of the rails tutorial is not possible
What to do if the app is not created with the latest Rails version installed when rails new
What to do if changes are not reflected after automatic deployment to EC2
What to do if the prefix c is not bound in JSP
What to do if the server tomcat dies
What to do if the image posted by refile disappears after setting a 404 error page in Rails
[Rails / Docker] What to do if access is denied by the browser (localhost: 3000) after adding a gem
What to do if the changes are not reflected in the jar manifest file
[Grails] Error occurred running What to do when the Grails CLI does not start
[Swift] What to do if the app icon is set but not reflected
What to do if the debug gem installation fails
What to do if rails server can't be stopped
What to do if audio is not available on discordrb
What to check when rails db: migration does not pass
What to do if FacesMessage is set but not displayed
# What to do if you accidentally do rails db: migrate: drop
What to do if the adb command cannot be executed
[Rails] What to do if you accidentally install bundle in the production environment in your local environment
[Rails] What to do if you can't get an error message with the errors method
What to do if you select a JRE in Eclipse and get "The selected JRE does not support the current compliance level 11"
What to do when "relation" hibernate_sequence "does not exist" in the ID column of PostgreSQL + JPA
What to do when the changes in the Servlet are not reflected
How to solve the problem that the website image is not displayed after deploying to heroku on Rails 5
What to do if the Eclipse Maven dependency Jar is wrong
What to do after Vagrant install
[Rails 5] [Turbolinks] What to do when JS does not work due to page transition or browser back
[Logback] What to do if unnecessary files do not disappear during rotation
What to do if the log using JUL is no longer output to the app log after deploying the Spring Boot app to Tomcat as a war
What to do if you get "Changes not staged for commit:" when you git status after git add.
What to do if you forget the root password in CentOS7
What to do if you cannot roll back the migration (UnknownMigrationVersionError)
[Rails] What to do if you can't get parameters with form_with
What to do if Operation not permitted is displayed when you execute a command in the terminal
What to do if you get an error during rails db: reset
What to do if you can't install the plugin from the Eclipse marketplace
What to do if deployment fails on Heroku (Ruby app not detected)
What to do if you don't like the code generated by swagger-codegen-cli
What to do after updating Dockerfile, docker-compose.yml
What to do if you install Ubuntu
[Rails] What to do if you get an error saying "Could not find a JavaScript runtime." When executing the rails s command on Catalina
[Rails] What to do when the Refile image is not displayed when writing the processing at the time of Routing Error
What to do if you get an "A server is already running." Error when you try to start the rails server
What to do if you get Could not save master table to file after importing a project in Eclipse