Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rake or Rails db:migrate

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!

like image 927
Llama.new Avatar asked Oct 10 '16 09:10

Llama.new


1 Answers

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.

like image 60
Andrey Deineko Avatar answered Sep 27 '22 02:09

Andrey Deineko