質問編集履歴

4

修正

2020/09/08 03:39

投稿

tomsuma
tomsuma

スコア38

test CHANGED
File without changes
test CHANGED
@@ -36,6 +36,10 @@
36
36
 
37
37
  ![イメージ説明](e8bf2c7ecf8283c254403eb123c6d9b0.png)
38
38
 
39
+
40
+
41
+ ![イメージ説明](d941668549b0aabc3a3510a7471a8441.png)
42
+
39
43
  ```
40
44
 
41
45
  初めのエラー

3

修正

2020/09/08 03:39

投稿

tomsuma
tomsuma

スコア38

test CHANGED
File without changes
test CHANGED
@@ -283,3 +283,61 @@
283
283
  CMD ["rails", "server", "-b", "0.0.0.0"]
284
284
 
285
285
  ```
286
+
287
+
288
+
289
+ ```database.yml
290
+
291
+
292
+
293
+ default: &default
294
+
295
+ adapter: mysql2
296
+
297
+ encoding: utf8
298
+
299
+ pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
300
+
301
+ username: root
302
+
303
+ password: example
304
+
305
+ # socket: /tmp/mysql.sock
306
+
307
+
308
+
309
+ host: db
310
+
311
+
312
+
313
+ development:
314
+
315
+ <<: *default
316
+
317
+ database: Books_development
318
+
319
+
320
+
321
+ test:
322
+
323
+ <<: *default
324
+
325
+ database: Books_test
326
+
327
+
328
+
329
+ production:
330
+
331
+ <<: *default
332
+
333
+ database: Books_production
334
+
335
+
336
+
337
+ username: root
338
+
339
+ password: <%= ENV['DATABASE_PASSWORD'] %>
340
+
341
+ # socket: /var/lib/mysql/mysql.sock
342
+
343
+ ```

2

修正

2020/09/08 01:49

投稿

tomsuma
tomsuma

スコア38

test CHANGED
File without changes
test CHANGED
@@ -6,13 +6,33 @@
6
6
 
7
7
  とあったのでbundle update minitest したのですが治りませんでした。。
8
8
 
9
+
10
+
11
+ 試したコマンド
12
+
13
+
14
+
9
- Mysql2でエラーが起きました、
15
+ bundle install
16
+
10
-
17
+ bundle update
18
+
11
-
19
+ bundle update minitest
20
+
21
+
22
+
12
-
23
+ エラー原因のminitestをgemgile.lookから消したのですが、
24
+
13
-
25
+ その他にも消かなくてはいけないパッケージがかなりあったのでやめました。
14
-
26
+
27
+
28
+
29
+
30
+
15
- ![イメージ説明](f702c00fb3ea15b6ab4d7d9aa5dda271.png)
31
+ ![イメージ説明](4c8ee58440d69d5baa090bbe5b765065.png)
32
+
33
+
34
+
35
+
16
36
 
17
37
  ![イメージ説明](e8bf2c7ecf8283c254403eb123c6d9b0.png)
18
38
 
@@ -163,3 +183,103 @@
163
183
  db_1 | 2020-09-07T13:36:53.453959Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.21' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server - GPL.
164
184
 
165
185
  ```
186
+
187
+
188
+
189
+ ```docker-compose.yml
190
+
191
+ docker-compose run web rails db:migrate RAILS_ENV=production
192
+
193
+ Starting books_db_1 ... done
194
+
195
+ Starting books_chrome_1 ... done
196
+
197
+ Creating books_web_run ... done
198
+
199
+ Could not find minitest-5.14.2 in any of the sources
200
+
201
+ Run `bundle install` to install missing gems.
202
+
203
+ ```
204
+
205
+
206
+
207
+ ```
208
+
209
+ version: '3'
210
+
211
+ services:
212
+
213
+ db:
214
+
215
+ image: mysql
216
+
217
+ volumes:
218
+
219
+ - ./tmp/db:/var/lib/mysql/data
220
+
221
+ web:
222
+
223
+ build: .
224
+
225
+ command: bash -c "rm -f tmp/pids/server.pid && bundle exec rails s -p 3000 -b '0.0.0.0'"
226
+
227
+ volumes:
228
+
229
+ - .:/Books
230
+
231
+ ports:
232
+
233
+ - "3000:3000"
234
+
235
+ depends_on:
236
+
237
+ - db
238
+
239
+ - chrome
240
+
241
+ stdin_open: true
242
+
243
+ tty: true
244
+
245
+ chrome:
246
+
247
+ image: selenium/standalone-chrome:3.141.59-dubnium
248
+
249
+ ports:
250
+
251
+ - 4444:4444
252
+
253
+ ```
254
+
255
+ ```dockerfile
256
+
257
+ FROM ruby:2.6.3
258
+
259
+ RUN apt-get update -qq && apt-get install -y nodejs postgresql-client yarn chromium-driver # yarnとchromium-driverを追記
260
+
261
+ RUN mkdir /Books
262
+
263
+ WORKDIR /Books
264
+
265
+ COPY Gemfile /Books/Gemfile
266
+
267
+ COPY Gemfile.lock /Books/Gemfile.lock
268
+
269
+ RUN gem install bundler
270
+
271
+ RUN bundle install
272
+
273
+ COPY . /Books
274
+
275
+ COPY entrypoint.sh /usr/bin/
276
+
277
+ RUN chmod +x /usr/bin/entrypoint.sh
278
+
279
+ ENTRYPOINT ["entrypoint.sh"]
280
+
281
+ EXPOSE 3000
282
+
283
+ CMD ["rails", "server", "-b", "0.0.0.0"]
284
+
285
+ ```

1

修正

2020/09/08 01:47

投稿

tomsuma
tomsuma

スコア38

test CHANGED
File without changes
test CHANGED
@@ -14,7 +14,7 @@
14
14
 
15
15
  ![イメージ説明](f702c00fb3ea15b6ab4d7d9aa5dda271.png)
16
16
 
17
-
17
+ ![イメージ説明](e8bf2c7ecf8283c254403eb123c6d9b0.png)
18
18
 
19
19
  ```
20
20