ruby-on-rails - Ruby On Rails - "OpenSSL::Cipher::CipherError at ..." when connecting to imported database
问题描述
I am running my Ruby On Rails 5 app on localhost and now, I imported the production database. It's a PostgreSQL database, exported via the pg_dump
tool.
When I modified the database.yml
file the Rails app and set there the newly created database, I got this error when running the Rails app (tried also to change the port on which the app is running, but it didn't help):
OpenSSL::Cipher::CipherError at /
In the Rails console is not any information about the error.
What is the reason of such an error? I tried to export the database from the staging server and use it on localhost and everything worked fine.
解决方案
基于文档:https ://ruby-doc.org/stdlib-2.4.1/libdoc/openssl/rdoc/OpenSSL/Cipher.html#method-i-final
看起来您没有正确的加密密钥来连接到生产数据库。
我猜你要么有合适的分期,要么分期运行未加密。
这是由不正确的密钥引起的相同错误的其他人:OpenSSL::Cipher::CipherError when running staging DB on local