Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backup:setup requires sudo #1

Open
ConfusedVorlon opened this issue Jul 3, 2017 · 0 comments
Open

backup:setup requires sudo #1

ConfusedVorlon opened this issue Jul 3, 2017 · 0 comments

Comments

@ConfusedVorlon
Copy link

I'm using rvm capistrano 3.8 and rails 5.0

backup:setup gives me a series of errors requiring sudo access

the fix for me was to blindly copy the bundle command from capistrano/bundler

  task :setup do
    on primary :web do
      backup_dir = "#{current_path}/#{fetch(:backup_path, 'backup')}"
      within backup_dir do
        with fetch(:bundle_env_variables, {}) do
          # execute :bundle
          options = []
          options << "--gemfile #{fetch(:bundle_gemfile)}" if fetch(:bundle_gemfile)
          options << "--path #{fetch(:bundle_path)}" if fetch(:bundle_path)
          unless test(:bundle, :check, *options)
            options << "--binstubs #{fetch(:bundle_binstubs)}" if fetch(:bundle_binstubs)
            options << "--jobs #{fetch(:bundle_jobs)}" if fetch(:bundle_jobs)
            options << "--without #{fetch(:bundle_without)}" if fetch(:bundle_without)
            options << "#{fetch(:bundle_flags)}" if fetch(:bundle_flags)
            execute :bundle, :install, *options
          end
        end
      end
    end
  end

I also needed to trigger this on

after 'deploy', 'backup:setup'

as the gems were lost on every deploy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant