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

failed to create symbolic link ‘./config/database.yml’: File exists #452

Closed
floydj opened this issue Oct 10, 2016 · 4 comments
Closed

Comments

@floydj
Copy link

floydj commented Oct 10, 2016

I get the above error when trying to migrate from 0.3.8 to 1.0.0.

The config/database.yml does already exist for some reason. No problems with this until I upgraded to 1.0. Any ideas on how to resolve?

@floydj floydj closed this as completed Oct 10, 2016
@floydj
Copy link
Author

floydj commented Oct 10, 2016

My fault...I see I only need to link the entire config directory now.

@floydj
Copy link
Author

floydj commented Oct 10, 2016

Actually, I think I need to reopen this.

If I have this in my config/deploy.rb file:

set :shared_dirs, fetch(:shared_dirs, []).push('log', 'output_documents', 'pdf_bundles',
                                               'files', 'public/uploads', 'public/system')
set :shared_files, fetch(:shared_files, []).push('config/database.yml',
                                                 'config/secrets.yml',
                                                 'config/central_documents.yml',
                                                 'config/paperclip_s3.yml')

Then I get the following:

$ ln -s "/home/deployer/teamsite/shared/config/secrets.yml" "./config/secrets.yml" ln: failed to create symbolic link ‘./config/secrets.yml’: File exists

How do I get this working the way it was under 0.3.8?

@floydj floydj reopened this Oct 10, 2016
@floydj
Copy link
Author

floydj commented Oct 10, 2016

I'm sorry...my fault again. I accidentally had the secrets.yml in my repo. Closing again.

@floydj floydj closed this as completed Oct 10, 2016
@ralfebert
Copy link
Contributor

Stumbled upon the same problem - I think it would make sense to delete :shared_files before linking because often these files are in the repo for development and are supposed to be overwritten by the link to the shared file under mina deployment.

Workaround: Delete them in the deploy after cloning like this:

  deploy do
    # Put things that will set up an empty directory into a fully set-up
    # instance of your project.
    invoke :'git:clone'
    fetch(:shared_files, []).each do |linked_path|
      command %{rm -f "./#{linked_path}"}
    end

gabskoro added a commit that referenced this issue Oct 16, 2016
Allow to overwrite existing :shared_files with the symlink to shared (fixes #452)
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

2 participants