質問編集履歴

2

データベースの設定について追記

2021/09/02 08:20

投稿

hase744
hase744

スコア57

test CHANGED
File without changes
test CHANGED
@@ -68,9 +68,55 @@
68
68
 
69
69
  ```yml
70
70
 
71
+ # SQLite. Versions 3.8.0 and up are supported.
72
+
73
+ # gem install sqlite3
74
+
75
+ #
76
+
77
+ # Ensure the SQLite 3 gem is defined in your Gemfile
78
+
79
+ # gem 'sqlite3'
80
+
81
+ #
82
+
83
+ default: &default
84
+
85
+ adapter: sqlite3
86
+
87
+ pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
88
+
89
+ timeout: 5000
90
+
91
+
92
+
93
+ development:
94
+
95
+ <<: *default
96
+
97
+ database: db/development.sqlite3
98
+
99
+
100
+
101
+ # Warning: The database defined as "test" will be erased and
102
+
103
+ # re-generated from your development database when you run "rake".
104
+
105
+ # Do not set this db to the same as development or production.
106
+
107
+ test:
108
+
109
+ <<: *default
110
+
111
+ database: db/test.sqlite3
112
+
113
+
114
+
71
115
  production:
72
116
 
73
117
  <<: *default
118
+
119
+ #database: db/production.sqlite3
74
120
 
75
121
  database: <%= Rails.application.credentials.db[:database] %>
76
122
 
@@ -79,6 +125,8 @@
79
125
  password: <%= Rails.application.credentials.db[:password] %>
80
126
 
81
127
  socket: <%= Rails.application.credentials.db[:socket] %>
128
+
129
+
82
130
 
83
131
  ```
84
132
 

1

データベースの設定について追記

2021/09/02 08:20

投稿

hase744
hase744

スコア57

test CHANGED
File without changes
test CHANGED
@@ -61,3 +61,63 @@
61
61
 
62
62
 
63
63
  ```
64
+
65
+
66
+
67
+ データベスの設定は以下の通りです
68
+
69
+ ```yml
70
+
71
+ production:
72
+
73
+ <<: *default
74
+
75
+ database: <%= Rails.application.credentials.db[:database] %>
76
+
77
+ username: <%= Rails.application.credentials.db[:username] %>
78
+
79
+ password: <%= Rails.application.credentials.db[:password] %>
80
+
81
+ socket: <%= Rails.application.credentials.db[:socket] %>
82
+
83
+ ```
84
+
85
+ ```yml
86
+
87
+ db:
88
+
89
+ database: ec_site
90
+
91
+ username: root
92
+
93
+ password: xxxxxx
94
+
95
+ socket: /var/lib/mysql/mysql.sock
96
+
97
+ ```
98
+
99
+
100
+
101
+
102
+
103
+ ちなみにsqliteにもデータベースはありませんでした。
104
+
105
+ ```command
106
+
107
+ [ec2-user@ip-10-0-0-235 ec_site]$ sqlite3
108
+
109
+ SQLite version 3.7.17 2013-05-20 00:56:22
110
+
111
+ Enter ".help" for instructions
112
+
113
+ Enter SQL statements terminated with a ";"
114
+
115
+ sqlite> .tables
116
+
117
+ sqlite>
118
+
119
+ ```
120
+
121
+
122
+
123
+ サーバーは一台しか作ってないはずです