-2
  1. What is the difference between commands rake and rails in Ruby?

  2. Which one is faster and why?

  3. Is rails duplicate command for rake?

  4. Can rails can be used for all tasks performed by rake or there is any limitation?

jonrsharpe
  • 115,751
  • 26
  • 228
  • 437

1 Answers1

3

rake allows you to run rakefiles (akin to makefiles).

Previously some commands were implemented as rake tasks and some were separate scripts. Hence some could be ran with rake and some with rails.

With RoR 5 the team agreed that this is an unnecessary complexity for newcomers and made it so all rails related rake commands could also be run with rails.

So in short:

  1. All rails related stuff that can be run with rake can also be ran with rails.
  2. Not all rails related stuff that can be run with rails can also be ran with rake.
  3. In terms of performance the difference is non-existent.

Hence - run everything rails related using rails and run rake tasks that you've defined yourself (if there are any) using rake.

ndnenkov
  • 35,425
  • 9
  • 72
  • 104