Blog Post - 23. November 2017
Execute a rake task like db:migrate from console

Execute a rake task like db:migrate from console

In some situations it is not possible to run rake tasks directly from the shell e.g. on a production server. You can use the %x[command] to execute code like rake tasks. For example, to trigger migrations from rails console you simply use:

%x[rake db:migrate]