質問編集履歴

3

エラーメッセージの修正

2019/12/03 11:18

投稿

Aker
Aker

スコア15

test CHANGED
File without changes
test CHANGED
@@ -18,11 +18,9 @@
18
18
 
19
19
  bundle exec rake db:create
20
20
 
21
- Created database 'myapp_development'
22
-
23
21
  Unknown MySQL server host 'db' (-2)
24
22
 
25
- Couldn't create 'myapp_test' database. Please check your configuration.
23
+ Couldn't create 'myapp_development' database. Please check your configuration.
26
24
 
27
25
  rake aborted!
28
26
 

2

2019/12/03 11:18

投稿

Aker
Aker

スコア15

test CHANGED
File without changes
test CHANGED
@@ -10,10 +10,6 @@
10
10
 
11
11
  Docker19.03.4
12
12
 
13
- ![イメージ説明](12ba541965891aa894edcf4f5349afc6.png)
14
-
15
- ![イメージ説明](c6033565046a25bab20262fd43cba4f6.png)
16
-
17
13
  エラーメッセージ
18
14
 
19
15
  ```

1

エラーメッセージをコードに修正し、docker-compose.ymlのrailsにlinks: -dbを加えました。

2019/12/03 10:16

投稿

Aker
Aker

スコア15

test CHANGED
File without changes
test CHANGED
@@ -14,6 +14,82 @@
14
14
 
15
15
  ![イメージ説明](c6033565046a25bab20262fd43cba4f6.png)
16
16
 
17
+ エラーメッセージ
18
+
19
+ ```
20
+
21
+ #!/bin/bash -eo pipefail
22
+
23
+ bundle exec rake db:create
24
+
25
+ Created database 'myapp_development'
26
+
27
+ Unknown MySQL server host 'db' (-2)
28
+
29
+ Couldn't create 'myapp_test' database. Please check your configuration.
30
+
31
+ rake aborted!
32
+
33
+ Mysql2::Error: Unknown MySQL server host 'db' (-2)
34
+
35
+ /home/circleci/repo/vendor/bundle/ruby/2.5.0/gems/mysql2-0.4.10/lib/mysql2/client.rb:89:in `connect'
36
+
37
+ /home/circleci/repo/vendor/bundle/ruby/2.5.0/gems/mysql2-0.4.10/lib/mysql2/client.rb:89:in `initialize'
38
+
39
+ /home/circleci/repo/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4/lib/active_record/connection_adapters/mysql2_adapter.rb:22:in `new'
40
+
41
+ /home/circleci/repo/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4/lib/active_record/connection_adapters/mysql2_adapter.rb:22:in `mysql2_connection'
42
+
43
+ /home/circleci/repo/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:830:in `new_connection'
44
+
45
+ /home/circleci/repo/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:874:in `checkout_new_connection'
46
+
47
+ /home/circleci/repo/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:853:in `try_to_checkout_new_connection'
48
+
49
+ /home/circleci/repo/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:814:in `acquire_connection'
50
+
51
+ /home/circleci/repo/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:538:in `checkout'
52
+
53
+ /home/circleci/repo/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:382:in `connection'
54
+
55
+ /home/circleci/repo/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:1033:in `retrieve_connection'
56
+
57
+ /home/circleci/repo/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4/lib/active_record/connection_handling.rb:118:in `retrieve_connection'
58
+
59
+ /home/circleci/repo/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4/lib/active_record/connection_handling.rb:90:in `connection'
60
+
61
+ /home/circleci/repo/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4/lib/active_record/tasks/mysql_database_tasks.rb:6:in `connection'
62
+
63
+ /home/circleci/repo/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4/lib/active_record/tasks/mysql_database_tasks.rb:14:in `create'
64
+
65
+ /home/circleci/repo/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4/lib/active_record/tasks/database_tasks.rb:119:in `create'
66
+
67
+ /home/circleci/repo/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4/lib/active_record/tasks/database_tasks.rb:139:in `block in create_current'
68
+
69
+ /home/circleci/repo/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4/lib/active_record/tasks/database_tasks.rb:316:in `block in each_current_configuration'
70
+
71
+ /home/circleci/repo/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4/lib/active_record/tasks/database_tasks.rb:313:in `each'
72
+
73
+ /home/circleci/repo/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4/lib/active_record/tasks/database_tasks.rb:313:in `each_current_configuration'
74
+
75
+ /home/circleci/repo/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4/lib/active_record/tasks/database_tasks.rb:138:in `create_current'
76
+
77
+ /home/circleci/repo/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4/lib/active_record/railties/databases.rake:29:in `block (2 levels) in <top (required)>'
78
+
79
+ /home/circleci/repo/vendor/bundle/ruby/2.5.0/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
80
+
81
+ /usr/local/bin/bundle:30:in `block in <main>'
82
+
83
+ /usr/local/bin/bundle:22:in `<main>'
84
+
85
+ Tasks: TOP => db:create
86
+
87
+ (See full trace by running task with --trace)
88
+
89
+ Exited with code 1
90
+
91
+ ```
92
+
17
93
  .circleci/config.yml
18
94
 
19
95
  ```
@@ -180,6 +256,10 @@
180
256
 
181
257
  - "SELENIUM_DRIVER_URL=http://selenium_chrome:4444/wd/hub"
182
258
 
259
+ links:
260
+
261
+ - db
262
+
183
263
  selenium_chrome:
184
264
 
185
265
  image: selenium/standalone-chrome-debug