LoginSignup
0
2

More than 3 years have passed since last update.

Rails 開発でよく使うコマンド一覧

Last updated at Posted at 2017-03-25

Rails 開発で、覚えていると便利な、使えるコマンドをメモします。

環境

  • macOS Catalina 10.15.6
  • Ruby 2.7.1
  • Ruby on Rails 6.0
# DB
% bin/rails db:migrate       # 未実行のマイグレーションがあれば実行
% bin/rails db:reset         # DB を再作成 & シードデータ投入
% bin/rails db:migrate:reset # マイグレーションファイルの頭からマイグレーションを実行し直す
% bin/rails db:test:load     # 現在の schema.rb からテスト用 DB を再作成
% bin/rails db:seed          # シードデータ投入

# ルーティング確認
% bin/rails routes

# データベースクライアント起動
% bin/rails db
% bin/rails db:test # テスト用 DB

# Rails コンソール起動
% bin/rails c

# サーバー起動
% bin/rails s
$ bin/rails s p # Production モード
0
2
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
2