Brot und Wasser Brot und Wasser - 1 month ago 23
Ruby Question

Rake or Rails db:mirate

I am new to RoR and am starting on the guide at http://guides.rubyonrails.org/getting_started.html .

When I run the command

bin/rails db:migrate
, I get the error
command db:migrate not recognized


But I am able to run the command
bin/rake db:migrate
without any issues.

My question is : is there any difference between the two or can I just rest easy and use rake? Thanks!

Answer

It depends on version of Rails. Before Rails 5.0 it was

rake db:migrate

Starting from Rails 5.0 it is

rails db:migrate

From changelog:

One Rails Command instead of the split-brain setup between rake and rails, so now it’s bin/rails db:migrate instead of bin/rake db:migrate

See changelog for full list of changes in Rails 5.

Comments