質問編集履歴

1

エラーメッセージの修正と試したことの追記

2019/07/23 08:47

投稿

jinugasachio
jinugasachio

スコア12

test CHANGED
File without changes
test CHANGED
@@ -14,9 +14,9 @@
14
14
 
15
15
  ```
16
16
 
17
- Step 17/19 : RUN RAILS_ENV=production bundle exec rake assets:precompile
17
+ Step 16/18 : RUN RAILS_ENV=production bundle exec rake assets:precompile
18
-
18
+
19
- ---> Running in 569f2ac95fe5
19
+ ---> Running in 48a40c520c0e
20
20
 
21
21
  rake aborted!
22
22
 
@@ -42,9 +42,55 @@
42
42
 
43
43
  /usr/local/bundle/gems/activesupport-5.2.3/lib/active_support/core_ext/module/delegation.rb:271:in `method_missing'
44
44
 
45
-
45
+ /usr/local/bundle/gems/devise-4.6.2/lib/devise/secret_key_finder.rb:24:in `key_exists?'
46
+
46
-
47
+ /usr/local/bundle/gems/devise-4.6.2/lib/devise/secret_key_finder.rb:10:in `find'
48
+
49
+ /usr/local/bundle/gems/devise-4.6.2/lib/devise/rails.rb:37:in `block in <class:Engine>'
50
+
51
+ /usr/local/bundle/gems/railties-5.2.3/lib/rails/initializable.rb:32:in `instance_exec'
52
+
53
+ /usr/local/bundle/gems/railties-5.2.3/lib/rails/initializable.rb:32:in `run'
54
+
55
+ /usr/local/bundle/gems/railties-5.2.3/lib/rails/initializable.rb:61:in `block in run_initializers'
56
+
57
+ /usr/local/bundle/gems/railties-5.2.3/lib/rails/initializable.rb:60:in `run_initializers'
58
+
59
+ /usr/local/bundle/gems/railties-5.2.3/lib/rails/application.rb:361:in `initialize!'
60
+
61
+ /myapp/config/environment.rb:5:in `<top (required)>'
62
+
63
+ /usr/local/bundle/gems/rake-12.3.2/exe/rake:27:in `<top (required)>'
64
+
65
+ /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:74:in `load'
66
+
67
+ /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:74:in `kernel_load'
68
+
69
+ /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:28:in `run'
70
+
71
+ /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli.rb:465:in `exec'
72
+
73
+ /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
74
+
75
+ /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
76
+
77
+ /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
78
+
79
+ /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli.rb:27:in `dispatch'
80
+
81
+ /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
82
+
83
+ /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli.rb:18:in `start'
84
+
85
+ /usr/local/bundle/gems/bundler-2.0.2/exe/bundle:30:in `block in <top (required)>'
86
+
87
+ /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors'
88
+
89
+ /usr/local/bundle/gems/bundler-2.0.2/exe/bundle:22:in `<top (required)>'
90
+
47
- 〜中略〜
91
+ /usr/local/bundle/bin/bundle:23:in `load'
92
+
93
+ /usr/local/bundle/bin/bundle:23:in `<main>'
48
94
 
49
95
 
50
96
 
@@ -70,13 +116,55 @@
70
116
 
71
117
  /usr/local/bundle/gems/activesupport-5.2.3/lib/active_support/encrypted_configuration.rb:38:in `options'
72
118
 
73
- /usr/local/bundle/gems/activesupport-5.2.3/lib/active_support/core_ext/module/delegation.rb:271:in
119
+ /usr/local/bundle/gems/activesupport-5.2.3/lib/active_support/core_ext/module/delegation.rb:271:in `method_missing'
120
+
74
-
121
+ /usr/local/bundle/gems/devise-4.6.2/lib/devise/secret_key_finder.rb:24:in `key_exists?'
122
+
75
-
123
+ /usr/local/bundle/gems/devise-4.6.2/lib/devise/secret_key_finder.rb:10:in `find'
124
+
76
-
125
+ /usr/local/bundle/gems/devise-4.6.2/lib/devise/rails.rb:37:in `block in <class:Engine>'
126
+
127
+ /usr/local/bundle/gems/railties-5.2.3/lib/rails/initializable.rb:32:in `instance_exec'
128
+
129
+ /usr/local/bundle/gems/railties-5.2.3/lib/rails/initializable.rb:32:in `run'
130
+
131
+ /usr/local/bundle/gems/railties-5.2.3/lib/rails/initializable.rb:61:in `block in run_initializers'
132
+
133
+ /usr/local/bundle/gems/railties-5.2.3/lib/rails/initializable.rb:60:in `run_initializers'
134
+
135
+ /usr/local/bundle/gems/railties-5.2.3/lib/rails/application.rb:361:in `initialize!'
136
+
137
+ /myapp/config/environment.rb:5:in `<top (required)>'
138
+
139
+ /usr/local/bundle/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require'
140
+
141
+ /usr/local/bundle/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
142
+
143
+ /usr/local/bundle/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
144
+
145
+ /usr/local/bundle/gems/railties-5.2.3/lib/rails/application.rb:337:in `require_environment!'
146
+
147
+ /usr/local/bundle/gems/railties-5.2.3/lib/rails/application.rb:520:in `block in run_tasks_blocks'
148
+
149
+ /usr/local/bundle/gems/sprockets-rails-3.2.1/lib/sprockets/rails/task.rb:62:in `block (2 levels) in define'
150
+
151
+ /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
152
+
153
+ /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli.rb:27:in `dispatch'
154
+
155
+ /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
156
+
157
+ /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli.rb:18:in `start'
158
+
159
+ /usr/local/bundle/gems/bundler-2.0.2/exe/bundle:30:in `block in <top (required)>'
160
+
161
+ /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors'
162
+
163
+ /usr/local/bundle/gems/bundler-2.0.2/exe/bundle:22:in `<top (required)>'
164
+
77
- 〜中略〜
165
+ /usr/local/bundle/bin/bundle:23:in `load'
166
+
78
-
167
+ /usr/local/bundle/bin/bundle:23:in `<main>'
79
-
80
168
 
81
169
  Tasks: TOP => environment
82
170
 
@@ -166,7 +254,7 @@
166
254
 
167
255
 
168
256
 
169
- //下記のコマンド中エラーが発生します//
257
+
170
258
 
171
259
  RUN RAILS_ENV=production bundle exec rake assets:precompile
172
260
 
@@ -186,293 +274,99 @@
186
274
 
187
275
  jobs:
188
276
 
277
+
278
+
279
+ ~中略~
280
+
189
- rubocop:
281
+ deploy:
190
282
 
191
283
  docker:
192
284
 
193
- - image: circleci/ruby:2.5.5-stretch-node-browsers-legacy
285
+ - image: circleci/python:3.7.4-stretch-node-browsers-legacy
194
-
195
- environment:
196
-
197
- RAILS_ENV: test
198
-
199
- MYSQL_HOST: 127.0.0.1
200
-
201
- BUNDLER_VERSION: 2.0.2
202
-
203
- - image: circleci/mysql:8.0.16-ram
204
-
205
- command: --default-authentication-plugin=mysql_native_password
206
-
207
- environment:
208
-
209
- MYSQL_HOST: 127.0.0.1
210
-
211
- MYSQL_USERNAME: root
212
-
213
- MYSQL_ROOT_PASSWORD: root
214
-
215
- MYSQL_DATABASE: myapp_test
216
-
217
-
218
-
219
- working_directory: ~/repo
220
-
221
-
222
286
 
223
287
  steps:
224
288
 
225
289
  - checkout
226
290
 
291
+ - setup_remote_docker
292
+
227
- - run:
293
+ - run:
228
-
294
+
229
- name: setup bundler
295
+ name: install aws
230
296
 
231
297
  command: |
232
298
 
233
- sudo gem update --system
234
-
235
- sudo gem uninstall bundler
236
-
237
- sudo rm /usr/local/bin/bundle
238
-
239
- sudo gem install bundler
299
+ sudo pip install awscli
240
-
241
- - restore_cache:
300
+
242
-
243
- keys:
244
-
245
- - v1-dependencies-{{ checksum "Gemfile.lock" }}
246
-
247
-
248
-
249
- - v1-dependencies-
250
-
251
- - run: bundle install --jobs=4 --retry=3 --path vendor/bundler
252
-
253
- - run: yarn install
254
-
255
- - save_cache:
301
+ aws --version
256
-
257
- paths:
302
+
258
-
259
- - ./vendor/bundler
260
-
261
- key: v1-dependencies-{{ checksum "Gemfile.lock" }}
262
-
263
- # Rubocop
264
-
265
- - run:
303
+ - run:
266
-
267
- name: Rubocop
304
+
268
-
269
- command: bundle exec rubocop
270
-
271
-
272
-
273
- rspec:
274
-
275
- docker:
276
-
277
- - image: circleci/ruby:2.5.5-stretch-node-browsers-legacy
278
-
279
- environment:
280
-
281
- RAILS_ENV: test
282
-
283
- MYSQL_HOST: 127.0.0.1
284
-
285
- BUNDLER_VERSION: 2.0.2
286
-
287
- - image: circleci/mysql:8.0.16-ram
288
-
289
- command: --default-authentication-plugin=mysql_native_password
290
-
291
- environment:
292
-
293
- MYSQL_HOST: 127.0.0.1
294
-
295
- MYSQL_USERNAME: root
296
-
297
- MYSQL_ROOT_PASSWORD: root
298
-
299
- MYSQL_DATABASE: myapp_test
300
-
301
-
302
-
303
- working_directory: ~/repo
304
-
305
-
306
-
307
- steps:
308
-
309
- - checkout
310
-
311
- - run:
312
-
313
- name: setup bundler
305
+ name: Install ecs-deploy
314
306
 
315
307
  command: |
316
308
 
317
- sudo gem update --system
318
-
319
- sudo gem uninstall bundler
309
+ curl https://raw.githubusercontent.com/silinternational/ecs-deploy/master/ecs-deploy | sudo tee -a /usr/bin/ecs-deploy
320
-
310
+
321
- sudo rm /usr/local/bin/bundle
311
+ sudo chmod +x /usr/bin/ecs-deploy
322
-
323
- sudo gem install bundler
312
+
324
-
325
- - restore_cache:
326
-
327
- keys:
328
-
329
- - v1-dependencies-{{ checksum "Gemfile.lock" }}
330
-
331
- - v1-dependencies-
332
-
333
- - run: bundle install --jobs=4 --retry=3 --path vendor/bundler
334
-
335
- - run: yarn install
336
-
337
- - save_cache:
338
-
339
- paths:
340
-
341
- - ./vendor/bundler
342
-
343
- key: v1-dependencies-{{ checksum "Gemfile.lock" }}
344
-
345
- - run: bundle exec rails db:create
346
-
347
-
348
-
349
-
350
-
351
- # Rspec
352
-
353
- - run:
313
+ - run:
354
-
314
+
355
- name: Rspec
315
+ name: Install jq
356
-
316
+
357
- command: bundle exec rspec
317
+ command: sudo apt-get install -y jq
358
-
359
-
360
-
361
- //ここからデプロイコード//
318
+
362
-
363
- deploy:
364
-
365
- docker:
366
-
367
- - image: circleci/python:3.7.4-stretch-node-browsers-legacy
368
-
369
- steps:
370
-
371
- - checkout
372
-
373
- - setup_remote_docker
374
-
375
- - run:
319
+ - run:
376
-
320
+
377
- name: install aws
321
+ name: Log in AWS ECR
322
+
323
+ command: eval $(aws ecr get-login --no-include-email --region ap-northeast-1)
324
+
325
+ - run:
326
+
327
+ name: Build & Push Docker Image
378
328
 
379
329
  command: |
380
330
 
381
- sudo pip install awscli
331
+ sudo docker build -f ./Dockerfile_pro -t myapp .
332
+
382
-
333
+ sudo docker tag myapp:latest $AWS_ACCOUNT_ID.dkr.ecr.ap-northeast-1.amazonaws.com/myapp:latest
334
+
383
- aws --version
335
+ sudo docker push $AWS_ACCOUNT_ID.dkr.ecr.ap-northeast-1.amazonaws.com/myapp:latest
384
-
336
+
385
- - run:
337
+ - run:
386
-
338
+
387
- name: Install ecs-deploy
339
+ name: "DB Migrate"
388
340
 
389
341
  command: |
390
342
 
343
+ aws ecs run-task \
344
+
391
- curl https://raw.githubusercontent.com/silinternational/ecs-deploy/master/ecs-deploy | sudo tee -a /usr/bin/ecs-deploy
345
+ --region ap-northeast-1 \
346
+
392
-
347
+ --cluster myapp \
348
+
349
+ --task-definition myapp \
350
+
393
- sudo chmod +x /usr/bin/ecs-deploy
351
+ --overrides file://ecs/run_task_db_migrate.json
394
-
352
+
395
- - run:
353
+ - run:
396
-
397
- name: Install jq
354
+
398
-
399
- command: sudo apt-get install -y jq
400
-
401
- - run:
402
-
403
- name: Log in AWS ECR
404
-
405
- command: eval $(aws ecr get-login --no-include-email --region ap-northeast-1)
406
-
407
- - run:
408
-
409
- name: Build & Push Docker Image
355
+ name: "Sevice deploy"
356
+
357
+ # environment:
410
358
 
411
359
  command: |
412
360
 
413
- sudo docker build -f ./Dockerfile_pro -t myapp .
414
-
415
- sudo docker tag myapp:latest $AWS_ACCOUNT_ID.dkr.ecr.ap-northeast-1.amazonaws.com/myapp:latest
416
-
417
- sudo docker push $AWS_ACCOUNT_ID.dkr.ecr.ap-northeast-1.amazonaws.com/myapp:latest
418
-
419
- - run:
420
-
421
- name: "DB Migrate"
422
-
423
- command: |
424
-
425
- aws ecs run-task \
426
-
427
- --region ap-northeast-1 \
428
-
429
- --cluster myapp \
430
-
431
- --task-definition myapp \
432
-
433
- --overrides file://ecs/run_task_db_migrate.json
434
-
435
- - run:
436
-
437
- name: "Sevice deploy"
438
-
439
- # environment:
440
-
441
- command: |
442
-
443
361
  ecs-deploy -c myapp-cluster -n myapp_app_service \
444
362
 
445
363
  -r ap-northeast-1 -t 240 \
446
364
 
447
365
  -i $AWS_ACCOUNT_ID.dkr.ecr.ap-northeast-1.amazonaws.com/myapp:$CIRCLE_SHA1
448
366
 
449
- workflows:
450
-
451
- version: 2
452
-
453
- test_deploy:
454
-
455
- jobs:
367
+ ~中略~
456
-
457
- - rubocop
368
+
458
-
459
- - rspec:
369
+
460
-
461
- requires:
462
-
463
- - rubocop
464
-
465
- - deploy:
466
-
467
- requires:
468
-
469
- - rspec
470
-
471
- filters:
472
-
473
- branches:
474
-
475
- only: master
476
370
 
477
371
  ```
478
372
 
@@ -508,6 +402,10 @@
508
402
 
509
403
 
510
404
 
405
+ circleciの検証はローカル環境で行なっております。
406
+
407
+
408
+
511
409
  Docker : 18.09.2
512
410
 
513
411
  CircleCI : 2