---
title: Capistrano deployment fails with link_tree argument must be a directory
url: https://calvin.my/posts/capistrano-deployment-fails-with-link_tree-argument-must-be-a-directory
published: 2024-06-23
updated: 2026-09-17
category: Development
tags:
- Rails
- Capistrano
summary: A Rails 7 deployment using Capistrano’s sample linked-directory configuration can fail during asset processing with a directory-related Sprockets error. The issue may stem from linking the entire vendor directory when it is absent or unsuitable for the expected asset structure. The post recommends removing that entry when unnecessary or linking the JavaScript-specific vendor subdirectory instead.
---

# 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

```ruby
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.

```ruby
# 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".
