1
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

「The name ' ' is either already used in your application or reserved by Ruby on Rails.」のエラーの解決法

Posted at

開発環境

Mac
Ruby 2.6.5
Rails 6.1.3.2

エラーメッセージ

$ The name 'Entry' is either already used in your application or reserved by Ruby on Rails.Please choose an alternative or use --skip-collision-check or --force to skip this check and run this generator again.

解決方法

% rails destroy model entry  

この後

 invoke  active_record
      remove    db/migrate/日にち_create_entries.rb
      remove    app/models/entry.rb
      invoke    test_unit
      remove      test/models/entry_test.rb
      remove      test/fixtures/entries.yml

が出ればモデルの削除ができています。

エラーの意味と原因

モデルを既に作成していました。

参考記事

[Rails] model名が原因でエラーになる場合の対処方法

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?