0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【Rails】本番環境構築で Missing service adapter for "GCS" と怒られる

Last updated at Posted at 2023-02-12

【Rails】本番環境構築で Missing service adapter for "GCS" と怒られる

状況

my 環境

・Rails 7
・active_storage 採用
・本番だけ GCS 使おうとしている
・render.com へデプロイしてる

production.rb で下記の指定をしていて、

  ...
  config.active_storage.service = :google
  ...

storage.yml で下記の指定をしている。

google:
  service: GCS 
  project: <%= ENV['GCS_PROJECT_NAME'] %>
  credentials: <%= ENV['GCS_KEYFILE'] %>
  bucket: <%= ENV['GCS_BUCKET'] %>

service: GCS で GCS を service adapter として使おうとしているけど、それが存在しない

エラーログ

Feb 12 03:50:31 PM  [69] ! Unable to load application: RuntimeError: Missing service adapter for "GCS"

こんな感じのエラーが出る

解決

gemfile に gem 'google-cloud-storage' を追加して bundle install すると治った

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?