paperclip-dropbox gem here을 사용하려고하는데 설정에 문제가 있고 자격 증명을 전달하는 중입니다.paperclip-dropbox gem이 잘못된 인수 유형을 throw합니다.
class User < ActiveRecord::Base
has_attached_file :avatar,
:storage => :dropbox,
:dropbox_credentials => "#{Rails.root}/config/dropbox.yml",
:dropbox_options => {...}
end
내 dropbox.yml 파일을 구성하고/config 폴더에 넣어했지만 나에게 파일이나 디렉토리 아무튼 말하고 레일 : 문서에서
는 모델의 설정과 같이 이루어집니다 존재하지 않습니다.내가 환경 변수와 해시 내 자격 증명을 전달하는 경우, 스택 추적의
:dropbox_credentials => {
app_key: ENV["DROPBOX_APP_KEY"],
app_secret: ENV["DROPBOX_APP_SECRET"],
access_token: ENV["DROPBOX_ACCESS_TOKEN"],
access_token_secret: ENV["DROPBOX_ACCESS_TOKEN_SECRET"],
user_id: ENV["DROPBOX_USER_ID"]
}
:dropbox_options => {
:path => ":attachment/:id/:basename.:extension"
}
상단은 다음과 같습니다
paperclip-dropbox (1.0.0) lib/paperclip/storage/dropbox.rb:59:in `path_for_url'
paperclip-dropbox (1.0.0) lib/paperclip/storage/dropbox.rb:55:in `path'
paperclip-dropbox (1.0.0) lib/paperclip/storage/dropbox.rb:41:in `exists?'
paperclip (3.2.0) lib/paperclip/attachment.rb:436:in `block in queue_all_for_delete'
paperclip (3.2.0) lib/paperclip/attachment.rb:435:in `map'
paperclip (3.2.0) lib/paperclip/attachment.rb:435:in `queue_all_for_delete'
paperclip (3.2.0) lib/paperclip/attachment.rb:213:in `clear'
paperclip (3.2.0) lib/paperclip/attachment.rb:94:in `assign'
paperclip (3.2.0) lib/paperclip.rb:196:in `block in has_attached_file'
activerecord (3.2.6) lib/active_record/attribute_assignment.rb:85:in `block in assign_attributes'
activerecord (3.2.6) lib/active_record/attribute_assignment.rb:78:in `each'
activerecord (3.2.6) lib/active_record/attribute_assignment.rb:78:in `assign_attributes'
activerecord (3.2.6) lib/active_record/persistence.rb:212:in `block in update_attributes'
activerecord (3.2.6) lib/active_record/transactions.rb:295:in `block in with_transaction_returning_status'
activerecord (3.2.6) lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
activerecord (3.2.6) lib/active_record/transactions.rb:208:in `transaction'
activerecord (3.2.6) lib/active_record/transactions.rb:293:in `with_transaction_returning_status'
activerecord (3.2.6) lib/active_record/persistence.rb:211:in `update_attributes'
app/controllers/users_controller.rb:45:in `update'
다음 레일
는 "잘못된 인수 유형 문자열 PROC 예상"라고저는 루비를 처음 접했고 procs를 이해하지 못했습니다. 작동 시키려면 어떻게 수정해야합니까?
': dropbox_options'에 무엇이 있습니까? –
오류의 전체 스택 추적을 추가 할 수 있습니까? –
@ ZachKemp, : dropbox_options 해시 및 스택 추적을 추가했습니다. 스택 트레이스를 살펴본 후에, 나는 문제가 저를 저장하려고하는 경로와 함께 있다고 생각하기 시작했습니다. 어떤 아이디어? – akonwi