質問編集履歴
1
補足
test
CHANGED
File without changes
|
test
CHANGED
@@ -2,23 +2,13 @@
|
|
2
2
|
|
3
3
|
|
4
4
|
|
5
|
-
ここに質問の内容を詳しく書いてください。
|
6
|
-
|
7
|
-
|
5
|
+
localhost/3000で['サ', 'ク', 'ラ', 'サ', 'ク']をRubyのrandを使用して、ランダムな値を生成し、配列の中から文言を取得させなさいと課題を出されたのですが。全く分かりません。
|
8
|
-
|
9
|
-
■■な機能を実装中に以下のエラーメッセージが発生しました。
|
10
|
-
|
11
|
-
|
12
6
|
|
13
7
|
### 発生している問題・エラーメッセージ
|
14
8
|
|
15
9
|
|
16
10
|
|
17
|
-
|
18
|
-
|
19
|
-
エラーメッセージ
|
20
|
-
|
21
|
-
```
|
11
|
+
/Users/sakura/camp/greeting/app/controllers/comments_controller.rb:7: syntax error, unexpected keyword_end end ^~~ /Users/sakura/camp/greeting/app/controllers/comments_controller.rb:11: syntax error, unexpected keyword_end end ^~~ /Users/sakura/camp/greeting/app/controllers/comments_controller.rb:21: syntax error, unexpected '=', expecting ';' or '\n' random = ["サ" , "ク... ^ /Users/sakura/camp/greeting/app/controllers/comments_controller.rb:25: syntax error, unexpected end-of-input, expecting keyword_end
|
22
12
|
|
23
13
|
|
24
14
|
|
@@ -26,24 +16,18 @@
|
|
26
16
|
|
27
17
|
|
28
18
|
|
29
|
-
```
|
19
|
+
```Ruby,
|
30
|
-
|
31
|
-
ソースコード
|
32
20
|
|
33
21
|
```
|
34
22
|
|
35
23
|
|
36
24
|
|
37
|
-
|
25
|
+
def
|
38
26
|
|
27
|
+
random = ["サ" , "ク" , "ラ" , "サ" , "ク"]
|
39
28
|
|
29
|
+
@random = Random.new(0..3)
|
40
30
|
|
41
|
-
|
31
|
+
puts random
|
42
32
|
|
43
|
-
|
44
|
-
|
45
|
-
### 補足情報(FW/ツールのバージョンなど)
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
33
|
+
end
|