LoginSignup
55
55

More than 5 years have passed since last update.

RoRでseedファイルを指定して実行したい時。

Posted at

いつも特定のファイルを指定して実行するときに忘れてしまうのとggってもrake task作ったりする記事が引っかかったりするので備忘録。

bundle exec rails r [実行したいseedファイルのpath]

とすると実行できる。

例えば以下のようなseedファイルを実行したい時。

db/seeds
└── user.rb
bundle exec rails r db/seeds/user.rb

と、するとdb/seeds/user.rbのみ実行することができる。

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