Capistrano deployment fails with link_tree argument must be a directory

In Rails 7, if you follow the sample configuration provided by Capistrano, you might have something like this in your deploy.rb

append :linked_dirs, "log", "tmp/pids", "tmp/cache", "tmp/sockets", "public/system", "vendor", "storage"

When running cap deploy with this configuration, it fails with an error.

# Sprockets::ArgumentError: link_tree argument must be a directory

This is likely caused by the "vendor" dir, remove it if it is not needed, or change it to "vendor/javascript".

AI Summary
gpt-4o-2024-05-13 2024-07-16 00:41:17
In Rails 7, Capistrano deploys may fail due to the "vendor" directory in the linked_dirs configuration. Remove "vendor" if unused or change it to "vendor/javascript" to resolve the "link_tree argument must be a directory" error.
Chrome On-device AI 2024-07-20 05:33:01

Share Article