[RUBY] Launch Rails on EC2 (manual deployment)

I have a diary.

We will steadily proceed with preparations for starting Rails on EC2, Start command! I think

image.png

master failed to start, check stderr log for details I got an error saying that it failed to start.

What is stderr? When I thought about it, I found it in config / unicorn.rb image.png That part. Is there an error log?

It seems that the contents of the file can be removed by using the less command, so I decided to type it in the terminal. Then image.png I noticed that this blue line appeared many times.

First of all, I looked into the file about what is called credential, but since it was a file I had never touched, I put it off. There seems to be something in access_key and secret_access_key above it. While investigating, it seems that I skipped one step to start, so I typed sudo vim / etc / environment in the terminal, image.png It is easy to solve by adding these two points.

It takes 3 hours to check and try it so far.

If you are worried about not starting Rails on EC2, check the above points and ・ Do you forget to push from local to GiuHub (check until merge) ・ Have you forgotten to reflect from Github to EC2 (git pull origin master)? -Did you find the cause by checking the contents of the error log on the EC2 server side? ・ Is the curriculum as described? ・ Is the database started correctly? -Are the environment variables on the EC2 server set correctly? -Try restarting the EC2 instance It is recommended to check.

Also, I didn't know how to restart the instance at first, so I created a completely different instance. In that case, right-click on the instance you don't need → instance status → end without any problem. It doesn't disappear immediately, but it seems to disappear in about 24 hours.

I hope it helps someone.

master failed to start, check stderr log for details bundler: failed to load command: unicorn_rails Aws::Sigv4::Errors::MissingCredentialsError: Cannot load Rails.config.active_storage.service: missing credentials, provide credentials with one of the following options:

Recommended Posts

Launch Rails on EC2 (manual deployment)
Launch Rails on EC2
Deploy RAILS on EC2
[EC2 / Vue / Rails] EC2 deployment procedure for Vue + Rails
Easy deployment with Capistrano + AWS (EC2) + Rails
Launch docker container on EC2 (personal memorandum)
Tailwind on Rails
EC2 on Docker-compose
Rails new in Ruby on Rails ~ Memorandum until deployment 2
Rails new in Ruby on Rails ~ Memorandum until deployment 1
Recipe for deploying Rails apps on AWS EC2
EC2 ✕ Manual deployment with Docker / docker-compose / Asset compilation
[Rails] Nginx, Puma environment deployment & server study [AWS EC2]
Rails Heroku deployment procedure
Ruby on Rails basics
[Rails] Heroku deployment flow
Yay! I'm on Rails!
Ruby On Rails Association
Launch Nuxt.js + Rails API on Docker and try CRUD operation
Created the first LINEbot on AWS Cloud9 (Rails + Heroku deployment)
I tried automatic deployment with CircleCI + Capistrano + AWS (EC2) + Rails
For beginners! Automatic deployment with Rails6 + CircleCI + Capistrano + AWS (EC2)
[Rails] Launch a new project
Resolve ActiveRecord :: NoDatabaseError on rails6
rails new application launch command
Launch a terminal on VScode
Ruby on rails learning record -2020.10.03
Install Sidekiq pro on Rails
Ruby on rails learning record -2020.10.04
[Ruby on Rails] Debug (binding.pry)
Ruby on rails learning record -2020.10.05
Ruby on rails learning record -2020.10.09
Ruby on Rails config configuration
Ruby on Rails basic learning ①
[Ruby on Rails] about has_secure_password
Ruby on rails learning record-2020.10.07 ②
Yay! I'm on Rails! Repetition
Install Rails on macOS Catalina
Commentary on partial! --Ruby on Rails
Post a video on rails
Install docker on AWS EC2
[Rails] EC site cart function
Ruby on rails learning record-2020.10.07 ①
Cancel Ruby on Rails migration
Ruby on rails learning record -2020.10.06
Ruby on Rails validation summary
Ruby on Rails Basic Memorandum
React.js CSS in Rails app deployed on EC2 cannot be loaded