【问题标题】:Could not load the 'pgcrypto' Active Record adapter无法加载“pgcrypto”Active Record 适配器
【发布时间】:2020-05-26 15:06:34
【问题描述】:

我需要在 postgresql 数据库中存储一些机密数据。为此,我使用了pgcrypto gem。我将此 gem 添加到 Gemfile 中,并将 database.yml 中的适配器名称更改为 pgcrypto。并在捆绑安装后执行以下命令。 rails generate pgcrypto:install。但我收到以下错误Could not load the 'pgcrypto' Active Record adapter. Ensure that the adapter is spelled correctly in config/database.yml and that you've added the necessary adapter gem to your Gemfile. (LoadError) 帮我解决这个问题。 Ruby-2.6.0 和 rails 5.2.4.2

【问题讨论】:

    标签: ruby-on-rails postgresql activerecord pgcrypto


    【解决方案1】:

    我查看了 gem“pgcrypto”,但我不确定它是否执行了在 Postgres 数据库中安装扩展程序所需的“创建扩展程序”行。您可以尝试在您的数据库中运行它吗?开发和测试?

    CREATE EXTENSION IF NOT EXISTS pgcrypto;
    

    【讨论】:

      猜你喜欢
      • 2020-11-24
      • 1970-01-01
      • 1970-01-01
      • 2020-01-14
      • 1970-01-01
      • 2022-11-11
      • 1970-01-01
      • 1970-01-01
      • 2019-06-28
      相关资源
      最近更新 更多