What is the difference between the
bundle&bundlercommands?What is the difference between
bundle&bundle install?If there're no differences, why have multiple commands that do the same thing?
1 Answers
The executables
bundle&bundlerhave the same functionality and therefore can be used interchangeably. You can see in thebundler/exedirectory that thebundlerexecutable just loads thebundleexecutable. It seems to me that thebundlecommand is more commonly used than thebundlercommand.The commands
bundle&bundle installalso have the same functionality.bundleuses Thor, andbundle's default task isinstall. Also,bundle idoes the same thing asbundle installbecausebundle's taskiis mapped (aliased) toinstall.That's a GREAT question. :-) Ruby tends to follow the Perl programming motto: "There's more than one way to do it." I tend to prefer the Zen of Python principle: "There should be one—and preferably only one—obvious way to do it." I think the latter principle caters to the principle of least astonishment and tends to help keep things simple. Overall however, I still tend to prefer to program in Ruby (especially when building HTTP-based RESTful APIs, for which I use Rack). I think Ruby is simple, elegant, and readable. Perhaps Ruby would be even better if it took on Python's stance regarding this issue.
- 121,420
- 116
- 450
- 651
-
2Kinda reminds of rails and rake in the latest versions of rails (5.x) https://stackoverflow.com/questions/38403533/rails-dbmigrate-vs-rake-dbmigrate. As a newcomer to Ruby and RoR, one command is easier to learn. – cdmo Sep 25 '18 at 19:54
-
11`bundle` and `bundler` can be used interchangeable … unless for some reason your system ends up with one version of `bundle` and an incompatible version of `bundler`. Hours of debugging fun ♂️ – FeifanZ Feb 27 '19 at 23:11