---
title:
  "Rails 7.1 raises RuntimeError if Active Storage service is not specified"
description:
  "Rails 7.1 raises RuntimeError if Active Storage service is not specified"
canonical_url: "https://www.bigbinary.com/blog/rails-7-1-raises-error-if-active-storage-service-not-specified"
markdown_url: "https://www.bigbinary.com/blog/rails-7-1-raises-error-if-active-storage-service-not-specified.md"
---

# Rails 7.1 raises RuntimeError if Active Storage service is not specified

Rails 7.1 raises RuntimeError if Active Storage service is not specified

- Author: Ghouse Mohamed
- Published: August 23, 2022
- Categories: Rails, Rails 7

If Active Storage has been configured, and the service type has not been
explicitly set in the respective environment's configuration file, then trying
to use active storage throws the following error message:

```plaintext
Failed to replace attachments_attachments because one or more of the new records could not be saved.
```

This is not helpful, and it doesn't indicate where to make the required changes
for Active Storage to be able to save the attachment(s). It also allows the
application to start as if a valid service has been set for Active Storage to
use. Starting Rails 7.1, if `config.active_storage.service` has not been
explicitly set, then even attempting to start the application would throw a
`RuntimeError` with the following error message:

```plaintext
Missing Active Storage service name. Specify Active Storage service name for config.active_storage.service in config/environments/production.rb
```

Please check out this [pull request](https://github.com/rails/rails/pull/44372)
for more details.

## Links

- [Human page](https://www.bigbinary.com/blog/rails-7-1-raises-error-if-active-storage-service-not-specified)
