I need to store some confidential data in postgresql database. In order to do that, I used pgcrypto gem. I added this gem to Gemfile and I have changed adapter name in database.yml as pgcrypto. and executed the following command after bundle install. rails generate pgcrypto:install
. But I got the following error 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)
Help me to fix this issue. Ruby-2.6.0 and rails 5.2.4.2
Asked
Active
Viewed 261 times
1
1 Answers
0
I looked at the gem "pgcrypto," and I'm not sure it executes the "create extension" line that's needed to install the extension in your Postgres database. Can you try running this in your database(s)? Development and Test?
CREATE EXTENSION IF NOT EXISTS pgcrypto;

richardun
- 693
- 5
- 11