0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

brakemanのアップデート

Posted at

Why?

rails new を実行したてのアプリをGithubにあげようとしたらエラーがでたので何をどうしたか記録。brakemanのバージョンの更新が必要だったというのと、db/schema.rbを作らないといけなかったという話。

①brakemanのバージョンが古いよエラー

brakeman

brakeman は Ruby on Rails アプリケーション用のセキュリティスキャナーらしく、このバージョンが古いと git で更新するように注意される。
brakemanについて

Gemfileの確認

Gemfileにbrakemanの記載があるか確認。

Gemfile
# Static analysis for security vulnerabilities [https://brakemanscanner.org/]
  gem "brakeman", require: false

require: false はアプリケーション実行時にbrakemanが自動的にロードされないようにするための設定。brakemanは開発時のセキュリティ解析ツールなので問題なし。

brakemanのバージョンの更新

brakemanのアップデート

$ bundle update brakeman

バージョン確認

$ bundle exec brakeman --version

②db/schema.rbが無いよエラー

db/schema.rb

これはdbのマイグレーションしていないと作成されないファイルなので、立ち上げたばかりではないんです。なのでひとまず空でいいのでマイグレーションしてあげようという話。

$ rails db:migrate

終わり

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?