LoginSignup
0
0

More than 3 years have passed since last update.

bundle exec annotate を実行しても反応しない

Last updated at Posted at 2020-05-20

状況

annotateのGemをインストールしてbundle exec annotateを実行しても何も表示されずエラーも帰ってこない。

実行後、modelsのファイルを開いてもスキーマの情報は追記されていない。

解決方法

1.annotateの設定ファイルを作成

rails g annotate:install

2.設定ファイルを修正

Railsアプリケーションフォルダの
lib/tasks/auto_annotate_models.rake を開く

auto_annotate_models.rake
      'show_indexes'              => 'true',

上の'true'部分を'false'に変更

auto_annotate_models.rake
    'show_indexes'              => 'false',

3.annotateを実行

bundle exec annotate

上記の方法でうまく行った場合はコマンド実行結果に以下が表示される

Annotated(数値): "modelsのファイル名列挙"

その後、modelsのファイルを開くとスキーマの情報がファイル先頭に追記されている

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