LoginSignup
1
0

More than 3 years have passed since last update.

error少しまとめ

Last updated at Posted at 2019-06-29
Cannot have a has_many :through association 'User#~~~' which goes through 'User#~~~' before the through association is defined.

→has_many :中間テーブル名 より has_many :○◯ through :中間テーブル名 が先に来てしまっているエラー

AugumentError in ~~~

→渡された引数と期待される引数の数が不一致から起こるエラー

Mysql2::Error: Cannot delete or update a parent row: a foreign key constraint fails

→外部キーが設定されているデータを削除出来ず起こるエラー
has_many:(オブジェクト名)にdependent: :destroyを追加するとオブジェクトに基づく他のオブジェクトも一緒に削除される

Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

→sudo service mysqld startでMySQLを起動させればOK

SyntaxError in 

→書き方間違いによる構文エラー
例:syntax error, unexpected tIDENTIFIER, expecting ')'
半角スペースとすべき所が全角スペースになっている。

ActionController::UrlGenerationError in 

→呼び出すアクションが違う。routingを確認すべし。

1
0
0

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
1
0