A.J*_*A.J 4 ruby ssl ruby-on-rails rails-activestorage
我查看了有关此错误的所有可能解决方案,但没有任何解决方案。
每次我尝试上传图像时,都会收到该错误。
在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
Run Code Online (Sandbox Code Playgroud)
我在 app/controllers/user_tests_controller.rb 中有这个
def user_test_params
params.require(:user_test).permit(:title, :caption, :image)
end
Run Code Online (Sandbox Code Playgroud)
**配置/存储.yml*
test:
service: Disk
root: <%= Rails.root.join("tmp/storage") %>
local:
service: Disk
root: <%= Rails.root.join("storage") %>
Run Code Online (Sandbox Code Playgroud)
我真的不知道为什么它不起作用。
编辑:
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
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
4522 次 |
最近记录: |