mina-deploy / mina

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

Could not install to path `vendor/bundle` because of an invalid symlink #535

Closed folivi closed 6 years ago

folivi commented 7 years ago

Hi, I'm having an issue deploying I'm on ruby 2.2.3 How can I fix it?

error: Could not install to path vendor/bundle because of an invalid symlink. Remove the symlink so the directory can be created.

task :deploy => :environment do
  on :before_hook do
    # Put things to run locally before ssh
  end
  deploy do
    # Put things that will set up an empty directory into a fully set-up
    # instance of your project.
    invoke :'git:clone'
    invoke :'deploy:link_shared_paths'
    invoke :'bundle:install'
    #invoke :'rails:db_load'
    #invoke :'load_db_schema'
    invoke :'rails:db_migrate'    
    invoke :'rails:assets_precompile'
    invoke :'deploy:cleanup'

    on :launch do      
      command "mkdir -p #{fetch(:deploy_to)}/#{fetch(:current_path)}/tmp/"
      command "touch #{fetch(:deploy_to)}/#{fetch(:current_path)}/tmp/restart.txt"
    end
  end
end
anilmaurya commented 7 years ago

I am also facing same issue.

This is related to invoke :'deploy:link_shared_paths' , Once I comment this task then mina deploy works.

Manfred commented 7 years ago

I assume this breaks because of a missing directory or file. Running mina setup solved the problem for me.

d4be4st commented 6 years ago

yes, you need to run setup to add new shared folders

rubywarlock commented 5 years ago

I solved it this way:

task :deploy do
  deploy do
    invoke :'rbenv:load'
    ...
  end
  ...
end

For rbenv.