[RAILS] What to do if changes are not reflected after automatic deployment to EC2

The content is as the title says, but when I automatically deployed to EC2, the changes were not reflected and I was very impatient. I will keep it as a memorandum so that I will not be impatient when the same thing happens in the future.

environment

AWS EC2 Ruby 2.6.5 Rails 6.0.3.3 capistrano

Conclusion

Restart your EC2 instance. If you perform automatic deployment multiple times, the changes may not be reflected. In that case, restart the instance. The restart procedure is explained in an easy-to-understand manner in this article.

Finally

Don't forget to restart the database and Nginx when you restart the instance!

  1. Log in to your EC2 instance

Terminal


hoge@MacBook ~ % cd .ssh  
hoge@MacBook .ssh % ssh -i Downloaded key name.pem ec2-user@Elastic IP associated with the relevant EC2 instance
  1. Restart the database (mariaDB this time) and Nginx

Terminal


[ec2-user@ip-173-41-45-198 ~]$ sudo systemctl restart mariadb 
[ec2-user@ip-173-41-45-198 ~]$ sudo systemctl restart nginx

Recommended Posts

What to do if changes are not reflected after automatic deployment to EC2
What to do if the changes are not reflected in the jar manifest file
What to do when the changes in the Servlet are not reflected
What to do if the background image is not applied after deployment
What to do if an SSH key authentication error occurs during automatic deployment to EC2 with Capistrano
What to do if deployment fails on Heroku (Ruby app not detected)
What to do if you get "Changes not staged for commit:" when you git status after git add.
[Swift] What to do if the app icon is set but not reflected
What to do if the update does not take effect after deploying Rails AWS
What to do if audio is not available on discordrb
What to do if FacesMessage is set but not displayed
What to do after Vagrant install
[Ubuntu 20.04] What to do if the external monitor is not recognized
[Rails] What to do if data is not registered in DB
[Logback] What to do if unnecessary files do not disappear during rotation
What to do after updating Dockerfile, docker-compose.yml
What to do if you install Ubuntu
What to do if the prefix c is not bound in JSP
What to do if the server tomcat dies
What to do immediately after introducing Material Design
What to do if you get Could not save master table to file after importing a project in Eclipse
What to do if you push incorrect information
What to do if mvn archetype: generate fails
What to do when debugging "Source not found"
What to do when routing settings do not work after building Docker environment with Laravel
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 the debug gem installation fails
What to do if the Rails server can't start
What to do when JSF tags do not become HTML
What to do if ClassNotFoundException occurs when starting Tomcat
What to do if rails server can't be stopped
What to do if TextToSpeech doesn't work on Android 11
What to do if you accidentally create a model
What to do if an ActionController :: UnknownFormat error occurs
What to do if password authentication fails in Docker/Postgres
[Maven] What to do if you are asked to incorporate a jar that is not in the remote repository into the war
[Java] [Spring] What to do if you cannot Autowire with Type Mismatch after annotating Spring Security
What to do if you installed Ruby with rbenv but the version does not change
[Swift5] What to do if you want to commit files to github but there are too many
What to do when Rails on Docker does not reflect controller changes in the browser
What to do if you get a java.io.IOException in GlassFish
What to do when Method not found in f: ajax
# What to do if you accidentally do rails db: migrate: drop
What to do if the adb command cannot be executed
What to do if mysql2 gets a bundle install error
What to do if you can't use the rails command
[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 you get a gcc error in Docker
What to do if validation doesn't work with the update action
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
What to do if the Eclipse Maven dependency Jar is wrong
[Rails] What to do when rails s does not respond or does not stop
What to do if you get a DISPLAY error in gym.render ()
What to do if you get angry with OpenSSL with pyenv install
What happened to the typical changes in Apache Wicket 8 after all?
What to do if you forget the root password in CentOS7
What to do if you cannot roll back the migration (UnknownMigrationVersionError)