質問編集履歴

1

該当の文字化け部分を記載しました。

2019/09/17 05:20

投稿

hai-sai.
hai-sai.

スコア9

test CHANGED
File without changes
test CHANGED
@@ -20,79 +20,7 @@
20
20
 
21
21
  エラーメッセージ
22
22
 
23
- ```rails aborted!
24
-
25
- SyntaxError: /Users/zujianyuye/Desktop/Progate_Rails2/db/migrate/20190913100533_create_posts.rb:3: syntax error, unexpected ',', expecting ')'
26
-
27
- create_table (:posts,options => 'ENGINE=InnoDB DEF...
23
+ irb(main):001:0> post1 = Post.new(content:"\U+FFE3\U+FFE3\U+FFE3")
28
-
29
- ^
30
-
31
- /Users/zujianyuye/Desktop/Progate_Rails2/db/migrate/20190913100533_create_posts.rb:3: syntax error, unexpected ')', expecting end
32
-
33
- ...E=InnoDB DEFAULT CHARSET=utf8') do |t|
34
-
35
- ... ^
36
-
37
- /Users/zujianyuye/Desktop/Progate_Rails2/db/migrate/20190913100533_create_posts.rb:4: syntax error, unexpected tSYMBEG, expecting end
38
-
39
- t.text :content
40
-
41
- ^
42
-
43
- /Users/zujianyuye/Desktop/Progate_Rails2/db/migrate/20190913100533_create_posts.rb:9: syntax error, unexpected end, expecting end-of-input
44
-
45
- /Users/zujianyuye/Desktop/Progate_Rails2/bin/rails:9:in `<top (required)>'
46
-
47
- /Users/zujianyuye/Desktop/Progate_Rails2/bin/spring:15:in `<top (required)>'
48
-
49
- bin/rails:3:in `load'
50
-
51
- bin/rails:3:in `<main>'
52
-
53
- Tasks: TOP => db:migrate
54
-
55
- (See full trace by running task with --trace)
56
-
57
- sokenikuyanoMacBook-Air:Progate_Rails2 zujianyuye$ rails db:migrate
58
-
59
- == 20190913100533 CreatePosts: migrating ======================================
60
-
61
- -- options()
62
-
63
- rails aborted!
64
-
65
- StandardError: An error has occurred, this and all later migrations canceled:
66
-
67
-
68
-
69
- undefined local variable or method `options' for #<CreatePosts:0x00007fb4f0f46288>
70
-
71
- /Users/zujianyuye/Desktop/Progate_Rails2/db/migrate/20190913100533_create_posts.rb:3:in `change'
72
-
73
- /Users/zujianyuye/Desktop/Progate_Rails2/bin/rails:9:in `<top (required)>'
74
-
75
- /Users/zujianyuye/Desktop/Progate_Rails2/bin/spring:15:in `<top (required)>'
76
-
77
- bin/rails:3:in `load'
78
-
79
- bin/rails:3:in `<main>'
80
-
81
-
82
-
83
- Caused by:
84
-
85
- NameError: undefined local variable or method `options' for #<CreatePosts:0x00007fb4f0f46288>
86
-
87
- /Users/zujianyuye/Desktop/Progate_Rails2/db/migrate/20190913100533_create_posts.rb:3:in `change'
88
-
89
- /Users/zujianyuye/Desktop/Progate_Rails2/bin/rails:9:in `<top (required)>'
90
-
91
- /Users/zujianyuye/Desktop/Progate_Rails2/bin/spring:15:in `<top (required)>'
92
-
93
- bin/rails:3:in `load'
94
-
95
- bin/rails:3:in `<main>'
96
24
 
97
25
 
98
26
 
@@ -102,7 +30,7 @@
102
30
 
103
31
  def change
104
32
 
105
- create_table(:posts,options => 'ENGINE=InnoDB DEFAULT CHARSET=utf8') do |t|
33
+ create_table :posts do |t|
106
34
 
107
35
  t.text :content
108
36
 
@@ -130,9 +58,9 @@
130
58
 
131
59
  ### 試したこと
132
60
 
61
+ pragma encoding;のコマンドで文字コードを確認しましたが、UTF−8になっています。
133
62
 
134
-
135
- ネットで調べて、'ENGINE=InnoDB DEFAULT CHARSET=utf8'などを追加してみました改善されません。初歩的な質問ですが、ご回答のほど宜しくお願いいたします。
63
+ ネットで調べても原因わかりません。原因のわかる方、ご回答のほど宜しくお願いいたします。
136
64
 
137
65
 
138
66