Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

bundle vs bundler / bundle vs bundle install

Tags:

bundler

  1. What is the difference between the bundle & bundler commands?

  2. What is the difference between bundle & bundle install?

  3. If there're no differences, why have multiple commands that do the same thing?

like image 763
ma11hew28 Avatar asked Apr 08 '17 19:04

ma11hew28


People also ask

What is the difference between bundle install and bundle update?

The most common question I've heard about Bundler is about the difference between bundle install and bundle update . In a nutshell: bundle install handles changes to the Gemfile and bundle update upgrades gems that are already managed by Bundler.

What is bundle install?

bundle install is a command we use to install the dependencies specified in your Gemfile.

What is bundle install deployment?

In deployment, isolation is a more important default. In addition, the user deploying the application may not have permission to install gems to the system, or the web server may not have permission to read them. As a result, bundle install --deployment installs gems to the vendor/bundle directory in the application.

What is bundle install in Rails?

Bundler makes sure that Ruby applications always use the exact gems and versions that you need while keeping a consistent environment and gem dependencies satisfied. This is done by ensuring that the gems you need are present in the development, staging, and production stages.


1 Answers

  1. The executables bundle & bundler have the same functionality and therefore can be used interchangeably. You can see in the bundler/exe directory that the bundler executable just loads the bundle executable. It seems to me that the bundle command is more commonly used than the bundler command.

  2. The commands bundle & bundle install also have the same functionality. bundle uses Thor, and bundle's default task is install. Also, bundle i does the same thing as bundle install because bundle's task i is mapped (aliased) to install.

  3. 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.

like image 144
ma11hew28 Avatar answered Oct 11 '22 07:10

ma11hew28



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!