OpenSSL::Cipher::CipherError Rails 5.2
OpenSSL::Cipher::CipherError Rails 5.2
我查看了有关此错误的所有可能的解决方案,但没有任何解决方案。
每次尝试上传图片时,我都会收到该错误消息。
在 config/application.rb
我有 require 'active_storage/engine'
未评论。
在 config/environments/development.rb
我已经 config.active_storage.service = :local
设置了。
我运行 rails active_storage:install
和rails db:migrate
.
模特的名字是user_test
class UserTest < ApplicationRecord
has_one_attached :image
end
我在 app/controllers/user_tests_controller.rb
中有这个
def user_test_params
params.require(:user_test).permit(:title, :caption, :image)
end
**config/storage.yml*
test:
service: Disk
root: <%= Rails.root.join("tmp/storage") %>
local:
service: Disk
root: <%= Rails.root.join("storage") %>
我真的不知道为什么它不起作用。
编辑:
Completed 500 Internal Server Error in 111ms (ActiveRecord: 43.1ms)
OpenSSL::Cipher::CipherError - :
(erb):12:in `<main>'
app/controllers/user_tests_controller.rb:27:in `create'
Started POST "/__better_errors/52f33e5e173d5e27/variables" for 127.0.0.1 at 2019-01-10 14:02:17 -0600
对不起我的英语不好。
我的解决方案是删除 storage.yml
中的所有代码注释
终于成功了。
我查看了有关此错误的所有可能的解决方案,但没有任何解决方案。
每次尝试上传图片时,我都会收到该错误消息。
在 config/application.rb
我有 require 'active_storage/engine'
未评论。
在 config/environments/development.rb
我已经 config.active_storage.service = :local
设置了。
我运行 rails active_storage:install
和rails db:migrate
.
模特的名字是user_test
class UserTest < ApplicationRecord
has_one_attached :image
end
我在 app/controllers/user_tests_controller.rb
中有这个def user_test_params
params.require(:user_test).permit(:title, :caption, :image)
end
**config/storage.yml*
test:
service: Disk
root: <%= Rails.root.join("tmp/storage") %>
local:
service: Disk
root: <%= Rails.root.join("storage") %>
我真的不知道为什么它不起作用。
编辑:
Completed 500 Internal Server Error in 111ms (ActiveRecord: 43.1ms)
OpenSSL::Cipher::CipherError - :
(erb):12:in `<main>'
app/controllers/user_tests_controller.rb:27:in `create'
Started POST "/__better_errors/52f33e5e173d5e27/variables" for 127.0.0.1 at 2019-01-10 14:02:17 -0600
对不起我的英语不好。
我的解决方案是删除 storage.yml
中的所有代码注释终于成功了。