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

質問編集履歴

3

コードの追加

2019/12/24 13:38

投稿

hiroro0820
hiroro0820

スコア13

title CHANGED
File without changes
body CHANGED
@@ -51,39 +51,34 @@
51
51
 
52
52
  変更後
53
53
  ```ここに言語を入力
54
- # SQLite. Versions 3.8.0 and up are supported.
55
- # gem install sqlite3
56
- #
57
- # Ensure the SQLite 3 gem is defined in your Gemfile
58
- # gem 'sqlite3'
59
- #
60
54
  default: &default
61
- adapter: sqlite3
55
+ adapter: mysql2
56
+ encoding: utf8
62
57
  pool: 5
63
- timeout: 5000
58
+ username: root
59
+ password:
60
+ host: localhost
64
61
 
62
+
65
63
  development:
66
- adapter: mysql2
67
- encoding: utf8
68
- database: peer
64
+ <<: *default
69
- pool: 5
70
- username: root
71
- password:
72
- host: localhost
65
+ database: peer_development # DBの名前。「sample」の部分をアプリの名前に変更すると分かりやい
73
66
 
74
- # Warning: The database defined as "test" will be erased and
75
- # re-generated from your development database when you run "rake".
76
- # Do not set this db to the same as development or production.
77
67
  test:
78
68
  <<: *default
79
- database: db/test.sqlite3
69
+ database: peer_test # DBの名前。「sample」の部分をアプリの名前に変更すると分かりやい
80
70
 
81
71
  production:
82
72
  <<: *default
83
- database: db/production.sqlite3
73
+ database: peer_production
74
+ username: peer_app
75
+ password: <%= ENV['PEER_DATABASE_PASSWORD'] %>
84
76
  ```
77
+ エラー文は
85
- これでも通りませんでした、、、、
78
+ ![イメージ説明](7c0a40544f952716c50e85e78c1978cb.jpeg)
86
79
 
80
+ これです!!
81
+
87
82
  ### 補足情報(FW/ツールのバージョンなど)
88
83
 
89
84
  ruby on rails 6

2

コードの追加

2019/12/24 13:38

投稿

hiroro0820
hiroro0820

スコア13

title CHANGED
File without changes
body CHANGED
@@ -20,7 +20,7 @@
20
20
  解決するには、dbをリセットするしか手段はないのでしょうか?
21
21
 
22
22
  ### 該当コード
23
- database.yml
23
+ 変更前database.yml
24
24
  ```ここに言語を入力
25
25
  # SQLite. Versions 3.8.0 and up are supported.
26
26
  # gem install mysql2
@@ -49,6 +49,41 @@
49
49
  database: db/production.mysql2
50
50
  ```
51
51
 
52
+ 変更後
53
+ ```ここに言語を入力
54
+ # SQLite. Versions 3.8.0 and up are supported.
55
+ # gem install sqlite3
56
+ #
57
+ # Ensure the SQLite 3 gem is defined in your Gemfile
58
+ # gem 'sqlite3'
59
+ #
60
+ default: &default
61
+ adapter: sqlite3
62
+ pool: 5
63
+ timeout: 5000
64
+
65
+ development:
66
+ adapter: mysql2
67
+ encoding: utf8
68
+ database: peer
69
+ pool: 5
70
+ username: root
71
+ password:
72
+ host: localhost
73
+
74
+ # Warning: The database defined as "test" will be erased and
75
+ # re-generated from your development database when you run "rake".
76
+ # Do not set this db to the same as development or production.
77
+ test:
78
+ <<: *default
79
+ database: db/test.sqlite3
80
+
81
+ production:
82
+ <<: *default
83
+ database: db/production.sqlite3
84
+ ```
85
+ これでも通りませんでした、、、、
86
+
52
87
  ### 補足情報(FW/ツールのバージョンなど)
53
88
 
54
89
  ruby on rails 6

1

コードの追加

2019/12/24 04:33

投稿

hiroro0820
hiroro0820

スコア13

title CHANGED
File without changes
body CHANGED
@@ -19,6 +19,36 @@
19
19
 
20
20
  解決するには、dbをリセットするしか手段はないのでしょうか?
21
21
 
22
+ ### 該当コード
23
+ database.yml
24
+ ```ここに言語を入力
25
+ # SQLite. Versions 3.8.0 and up are supported.
26
+ # gem install mysql2
27
+ #
28
+ # Ensure the SQLite 3 gem is defined in your Gemfile
29
+ # gem 'mysql2'
30
+ #
31
+ default: &default
32
+ adapter: mysql2
33
+ pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
34
+ timeout: 5000
35
+
36
+ development:
37
+ <<: *default
38
+ database: db/development.mysql2
39
+
40
+ # Warning: The database defined as "test" will be erased and
41
+ # re-generated from your development database when you run "rake".
42
+ # Do not set this db to the same as development or production.
43
+ test:
44
+ <<: *default
45
+ database: db/test.mysql2
46
+
47
+ production:
48
+ <<: *default
49
+ database: db/production.mysql2
50
+ ```
51
+
22
52
  ### 補足情報(FW/ツールのバージョンなど)
23
53
 
24
54
  ruby on rails 6