LoginSignup
6
2

More than 3 years have passed since last update.

#エラー解消 syntax error, unexpected tIDENTIFIER, expecting ')'

Posted at

したこと

ダミーデータをcreateして、データベースに登録$rails db:seedしようとしたら出たエラーです。

エラーメッセージ
$bin/rails db:seed
rails aborted!
SyntaxError: /Users/ホーム/ペアレントディレクトリ/カレントディレクトリ/db/seeds.rb:12: syntax error, unexpected tIDENTIFIER, expecting ')'

答え

「,」カンマ抜けでした。

db/seeds.rb
Diary.create(
  title: "夏", ⬅このカンマ
  body: "BBQ、プール、ビアガーデン、水族館"
)

細かいミス。

6
2
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
2