What is the difference between commands
rakeandrailsin Ruby?Which one is faster and why?
Is
railsduplicate command forrake?Can
railscan be used for all tasks performed byrakeor there is any limitation?
Asked
Active
Viewed 242 times
-2
jonrsharpe
- 115,751
- 26
- 228
- 437
Muhammad Huzaifa
- 249
- 1
- 9
1 Answers
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:
- All rails related stuff that can be run with
rakecan also be ran withrails. - Not all rails related stuff that can be run with
railscan also be ran withrake. - 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
-
@muhammad - `rails` commands are like `rake` tasks, but only for rails. – B Seven May 28 '21 at 16:47