Help us understand the problem. What is going on with this article?

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

状況

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のファイルを開くとスキーマの情報がファイル先頭に追記されている

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした