mina-deploy / mina

Blazing fast deployer and server automation tool
https://rubygems.org/gems/mina
Other
4.34k stars 491 forks source link

Use bundle config instead of install options when running with Bundler version 2 #666

Closed Manfred closed 2 years ago

Manfred commented 3 years ago

Since Bundler version 2 it is deprecated to set install options when calling bundle install. Instead you are expect to use bundle config before running bundle install.

References #657.

lovro-bikic commented 2 years ago

Thanks for the PR, however, Mina will change the approach for setting the bundle config from version 2.0. The preferred way for specifying bundle options is through environment variables and the config file (see bundle config docs).

You can override the default config by either adding a file .bundle/config to your repo with the desired configuration, or you can override the config path by setting the BUNDLE_APP_CONFIG environment variable, which you can do in Mina like this:

set :bundle_options, ''

task :deploy do
  deploy do
    command "export BUNDLE_APP_CONFIG='.bundle/myconfig'"
    invoke :'bundle:install'
  end
end

Mina 2.0 will provide a variable for setting the BUNDLE_APP_CONFIG path, but until then you can use the command method.