How should I use a batch installation - a standard with a Rails application?

bundle install --standalone seems like a great idea, but it's hard for me to envelop how to use it, which does not end there, requiring you to have rubigems or a picker.

It generates bundler / setup.rb, which adds the lib and ext directories of my gems, apparently in order. Presumably, all I need to do is add it to the download path, and all is well.

But bundler / setup.rb does not seem to require anything.

Now, this is fine, because the normal bundler / setup requires nothing and leaves it in the application to call Bundler.require

Rails by default require this little tune:

 if defined?(Bundler) Bundler.require(*Rails.groups(:assets => %w(development test))) end 

At the point at which it hits, the Bundler not defined (bundler / setup.rb does not define it), so it skips the block.

So how exactly do I need a package. If the bundle install --standalone really connected by a connected one, presumably, I could manually call require bundler and then define the Bundler , but it seems to exclude itself from the package.

Is there an application that actually uses bundle install --standalone , and if so, how?

+7
source share
2 answers

To make this work with Rails, you delete the Bundler.require call and manually add all the required lines where they are needed.

It has pros and cons. On the plus side, this can make loading your application faster, since not all gems should be required at boot time. It also makes it clear which gems are used there.

At the bottom, you should add all the necessary calls to your application.

Take a look at the Myron Marstons blog post for a better explanation.

+2
source

bundle install --deployment #install ruby ​​and related pearls in the project directory

-one
source

All Articles