teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

2

deploy.rb追記

2021/03/16 04:39

投稿

ik_ko
ik_ko

スコア9

title CHANGED
File without changes
body CHANGED
@@ -78,4 +78,54 @@
78
78
  RDS_PASSWORD =
79
79
  RDS_ENDPOINT =
80
80
 
81
+ ```
82
+ deploy.rb
83
+ ```
84
+ # config valid for current version and patch releases of Capistrano
85
+ lock "~> 3.16.0"
86
+
87
+ set :application, "sdf_app"
88
+ set :repo_url, "git@github.com:ikkorokoro/sdf-app.git"
89
+ set :rbenv_ruby, File.read('.ruby-version').strip
90
+
91
+ # Nginxの設定ファイル名と置き場所を修正
92
+ set :nginx_config_name, "#{fetch(:application)}.conf"
93
+ set :nginx_sites_enabled_path, "/etc/nginx/conf.d"
94
+
95
+ append :linked_files, "config/master.key"
96
+ append :linked_dirs, "log", "tmp/pids", "tmp/cache", "tmp/sockets", "node_modules"
97
+ # Default branch is :master
98
+ # ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp
99
+
100
+ # Default deploy_to directory is /var/www/my_app_name
101
+ # set :deploy_to, "/var/www/my_app_name"
102
+
103
+ # Default value for :format is :airbrussh.
104
+ # set :format, :airbrussh
105
+
106
+ # You can configure the Airbrussh format using :format_options.
107
+ # These are the defaults.
108
+ # set :format_options, command_output: true, log_file: "log/capistrano.log", color: :auto, truncate: :auto
109
+
110
+ # Default value for :pty is false
111
+ # set :pty, true
112
+
113
+ # Default value for :linked_files is []
114
+ # append :linked_files, "config/database.yml"
115
+
116
+ # Default value for linked_dirs is []
117
+ # append :linked_dirs, "log", "tmp/pids", "tmp/cache", "tmp/sockets", "public/system"
118
+
119
+ # Default value for default_env is {}
120
+ # set :default_env, { path: "/opt/ruby/bin:$PATH" }
121
+
122
+ # Default value for local_user is ENV['USER']
123
+ # set :local_user, -> { `git config user.name`.chomp }
124
+
125
+ # Default value for keep_releases is 5
126
+ # set :keep_releases, 5
127
+
128
+ # Uncomment the following to require manually verifying the host key before first deploy.
129
+ # set :ssh_options, verify_host_key: :secure
130
+
81
131
  ```

1

database.yml .envの追記

2021/03/16 04:38

投稿

ik_ko
ik_ko

スコア9

title CHANGED
File without changes
body CHANGED
@@ -28,4 +28,54 @@
28
28
  Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
29
29
  ```
30
30
  上記のエラー後、サーバー側のmysqlにはログインできることは確認できています。
31
- 上記のエラーが発生したので原因がわかる方がいましたらご教授して頂きでたいです。
31
+ 上記のエラーが発生したので原因がわかる方がいましたらご教授して頂きでたいです。
32
+
33
+ 以下追記させて頂きます。
34
+ database.yml
35
+ ```
36
+ default: &default
37
+ adapter: mysql2
38
+ encoding: utf8mb4
39
+ pool: 5
40
+ username: <%= ENV['DB_USER'] %>
41
+ password: <%= ENV['DB_PASSWORD'] %>
42
+ socket: /tmp/mysql.sock
43
+ host: localhost
44
+
45
+ development:
46
+ <<: *default
47
+ database: <%= ENV['DB_NAME'] %>
48
+
49
+ test:
50
+ <<: *default
51
+ database: sdf_app_test
52
+
53
+ production:
54
+ adapter: mysql2
55
+ encoding: utf8mb4
56
+ pool: 5
57
+ database: sdf_app_production
58
+ username: root
59
+ password: <%= ENV['RDS_PASSWORD'] %>
60
+ host: <%= ENV['RDS_ENDPOINT'] %>
61
+ ```
62
+ .env(流出するので値のみ削除しています)
63
+ ```
64
+ DB_USER =
65
+ DB_PASSWORD =
66
+ DB_NAME =
67
+ LANG =
68
+ RACK_ENV =
69
+ RAILS_ENV =
70
+ RAILS_LOG_TO_STDOUT =
71
+ RAILS_SERVE_STATIC_FILES =
72
+ SDF_APP_DATABASE_PASSWORD =
73
+ DATABASE_URL =
74
+ SECRET_KEY_BASE =
75
+ AWS_ACCESS_KEY =
76
+ AWS_SECRET_KEY =
77
+ AWS_BUCKET_NAME =
78
+ RDS_PASSWORD =
79
+ RDS_ENDPOINT =
80
+
81
+ ```