---
title: Error deploying solid cache - ArgumentError
url: https://calvin.my/posts/error-deploying-solid-cache-argumenterror
published: 2024-12-15
updated: 2026-09-17
category: Development
tags:
- Rails
- solid cache
- error
summary: Solid Cache deployments can fail with an ArgumentError when both a database setting and a connection mapping are configured. The conflict typically arises because Solid Cache’s default configuration uses a dedicated database, while an added connection mapping specifies the same target differently. Resolve the issue by retaining only one configuration approach. The post notes that this differs from Solid Queue, which defaults to connection mappings, making the distinction potentially confusing.
---

# Error deploying solid cache - ArgumentError

1. If you get the following error when deploying `Solid Cache`.

   ```ruby
   ArgumentError: You can only specify one of :database, :databases, or :connects_to (ArgumentError)
   ```

2. The reason is likely you added connects\_to in your configuration file. It conflicts with the database config created by default.

   ```yaml
   # config/cache.yml

   production:
     database: cache
     <<: *default

   # config/environments/production.rb

   config.solid_cache.connects_to = { database: { writing: :cache } }
   ```

3. To fix the error, keep only one of the above.

4. It is slightly confusing at the moment. Solid Queue creates `connects_to` as default, but Solid Cache creates database as default.
