質問編集履歴
1
補足
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,25 +1,17 @@
|
|
1
1
|
### 前提・実現したいこと
|
2
2
|
|
3
|
-
ここに質問の内容を詳しく書いてください。
|
4
|
-
|
3
|
+
localhost/3000で['サ', 'ク', 'ラ', 'サ', 'ク']をRubyのrandを使用して、ランダムな値を生成し、配列の中から文言を取得させなさいと課題を出されたのですが。全く分かりません。
|
5
|
-
■■な機能を実装中に以下のエラーメッセージが発生しました。
|
6
|
-
|
7
4
|
### 発生している問題・エラーメッセージ
|
8
5
|
|
9
|
-
|
10
|
-
エラーメッセージ
|
11
|
-
```
|
6
|
+
/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
|
12
7
|
|
13
8
|
### 該当のソースコード
|
14
9
|
|
15
|
-
```
|
10
|
+
```Ruby,
|
16
|
-
ソースコード
|
17
11
|
```
|
18
12
|
|
13
|
+
def
|
14
|
+
random = ["サ" , "ク" , "ラ" , "サ" , "ク"]
|
15
|
+
@random = Random.new(0..3)
|
19
|
-
|
16
|
+
puts random
|
20
|
-
|
21
|
-
ここに問題に対して試したことを記載してください。
|
22
|
-
|
23
|
-
### 補足情報(FW/ツールのバージョンなど)
|
24
|
-
|
25
|
-
|
17
|
+
end
|