Do Rails 3 "bundle install" and "bundle install --deployment" work well, except that the second uses more disk space?

It looks like on development machines (like Macbooks), if we use bundle install --deployment , all the gems will be installed in the vendor/bundle folder, and just use more disk space if we have several Rails 3 projects (some project for testing Rails only 3). If this is not --deployment , then the gems will be in the "shared" folder, and not inside the project folder, and therefore can be shared for different projects. It's true?

Another thing is, do we need to add all the files in vendor/bundle to our repository and click it? It seems that if we do this, we will simply launch the repo, because if we do not, all suitable stones will be installed by bundle install using all the gems specified in Gemfile.lock . ( Gemfile.lock is a small file in the repo). Is that also true?

+13
ruby-on-rails ruby-on-rails-3 bundler
Sep 09 '10 at 23:34
source share
2 answers

Yes! Truth.

When you use the --deployment flag, the Bundler ensures that every gem you need is a seller, i.e. they are copied to a predetermined place in the structure of your application folder (which, as a rule, is vendor/bundle in Rails by agreement). This is good for two things.

First, if you have limited permissions that prevent the installation of stones on your deployment computer, then let you have all the necessary stones in your application.

Secondly, if you want to crack the actual code in gems, you can do it on your copies without affecting system gems. The changes you make will only affect the application you are working on.

This use approach, used for other uses, ensures that you are using a specific version of the gem and your application will work even if the system gems have been upgraded to a higher version that will break your application. However, Bundler himself made this use case mostly obsolete, since he automated the installation and binding of specific versions of gemstones.

And yes, the seller will inflate your application code. Gemfile.lock is just a list of the gems you need. If you sell your gems, they will be fully copied to your application.

So, I recommend you not the supplier of your gems (this also means that you do not use the --deployment flag) if you do not have one of the reasons mentioned above.

+36
Sep 09 '10 at 23:56 on
source share

I think the provider / package will not affect the repo if the repo allows you to ignore files.
It can be ignored (by adding the path to .gitignore if you are using git), and the server has a symbolic link for sharing gems with multiple versions.

+2
May 13 '11 at 11:08
source share



All Articles