sasakiyuuya@mbp ~ % cd .ssh
sasakiyuuya@mbp .ssh % chmod 400 jojotech.pem
sasakiyuuya@mbp .ssh % ssh -i jojotech.pem ec2-user@54.249.7.206
[ec2-user@ip-10-0-8-195 ~]$ cd /var
[ec2-user@ip-10-0-8-195 var]$ sudo chmod 755 www
[ec2-user@ip-10-0-8-195 var]$ cd www/
[ec2-user@ip-10-0-8-195 www]$ sudo git clone https://github.com/jojo232/cloud9.git
[ec2-user@ip-10-0-8-195 cloud9]$ gem install bundler
[ec2-user@ip-10-0-8-195 ~]$ gem install rails -v 6.1.4
[ec2-user@ip-10-0-8-195 ~]$ cd /var/www/cloud9
[ec2-user@ip-10-0-8-195 cloud9]$ bundle install
[ec2-user@ip-10-0-8-195 cloud9]$ sudo chown -R ec2-user:ec2-user .
vim config/database.yml ←ファイル変更
production:
<<: *default
database: jojorion_production
username: admin
password: adminadmin
host: raistech-live8-2022-database-1.crsw7ysdmznk.ap-northeast-1.rds.amazonaws.com
[ec2-user@ip-10-0-8-195 cloud9]$bundle exec rails webpacker:install
[ec2-user@ip-10-0-8-195 cloud9]$EDITOR=vim bin/rails credentials:edit
↓ローカルフォルダーからマスターキーを引っ張ってくる
sasakiyuuya@mbp jojorion % cat config/master.key
24496010253b94a8ab64e93fe0257ccd
[ec2-user@ip-10-0-8-195 cloud9]$vim config/master.key
[ec2-user@ip-10-0-8-195 cloud9]$RAILS_ENV=poroduction bundle exec rails db:create
[ec2-user@ip-10-0-8-195 cloud9]$RAILS_ENV=poroduction bundle exec rails db:migrate
[ec2-user@ip-10-0-8-195 cloud9]$RAILS_ENV=poroduction bundle exec rails s -b 0.0.0.0