-1
나는 AWS-SDK의 보석 및 클립/클립-AWS 보석의 다른 버전을했지만,이 오류가 사라지지 않을 것입니다레일 5
ActionView::Template::Error (uninitialized constant Paperclip::Storage::Aws::VERSION):
과 :
를Extracted source (around line #25):
<td><b><%= article.title %></b></td>
<td><%= simple_format h(article.text) %></td>
<td><i><%= link_to article.attachment_file_name, article.attachment.url(:original, false) %></i></td>
</tr>
는 어디 라이브러리 오류가 있습니까?
이 코멘트에서 내 Gemfile 발췌, 질문 :
#Paperclip
gem 'paperclip', git: 'git://github.com/thoughtbot/paperclip.git'
gem 'aws-sdk', '~> 2.0'
gem 'aws-sdk-resources', '~> 2'
gem 'paperclip-aws'
업데이트 : 내가 여기 db:reset Heroku가 생산에 같은 데이터베이스를 청소하고 로컬 컴퓨터에 SQLite는 파일을 삭제했다.
Extracted source (around line #24):
def create
@article = Article.new(article_params)
if @article.save
redirect_to @article
을 다음과 같이 매개 변수는 다음과 같습니다 : 그런 다음 같은 Aws::VERSION
오류가 내 ArticlesController에서 온다 지금
Parameters:
{"utf8"=>"✓", "authenticity_token"=>"FpE3KDmkv6ofsavuUiAynp9H9o31w+EYAh/ONQfuTHLDl+7EjfucF4kxn+ XHzwHJsdOMrPJ+7Sm8oVEg5PzxqA==",
"article"=>
{"title"=>"test7",
"text"=>"",
"attachment"=>
#<ActionDispatch::Http::UploadedFile:0x9653310
@content_type="text/plain",
@headers="Content-Disposition: form-data; name=\"article[attachment]\"; filename=\"HRNG.txt\"\r\nContent-Type: text/plain\r\n",
@original_filename="HRNG.txt",
@tempfile=#<File:C:/Users/Lap127/AppData/Local/Temp/RackMultipart20170202-9024-2uphpe.txt>>},
"commit"=>"Create Article"}
오류 메시지 : 내 응용 프로그램/모델/기사를 추가
NameError (uninitialized constant Paperclip::Storage::Aws::VERSION):
. 속성 변경시 오류 변경을위한 rb, 예를 들면. 지. :bucket
class Article < ApplicationRecord
has_many :comments, dependent: :destroy
validates :title, presence: true,
length: { minimum: 5 }
has_attached_file :attachment,
:path => 'assets/:class/:attachment/:id/:style/:filename',
:storage => :s3,
:s3_bucket => ENV['AWS_BUCKET'],
:s3_permissions => 'public_read_write',
:s3_protocol => 'https',
:s3_host_name => 'eu-central-1.amazonaws.com',
:s3_host_alias => 'eu-central-1.amazonaws.com',
:s3_region => ENV['AWS_REGION'],
:s3_credentials => { :access_key_id => ENV['AWS_ACCESS_KEY_ID'],
:secret_access_key => ENV['AWS_SECRET_KEY_ID'],
:endpoint => 'eu-central-1.amazonaws.com' }
# Explicitly do not validate
do_not_validate_attachment_file_type :attachment
#validates_attachment :attachment, content_type: { content_type: 'application/x-java-archive'}, size: { in: 0..10.megabytes }
end
어떻게 Gemfile에서 보석을 선언하고 있습니까? 때로는 초기화되지 않은 상수는 보석이로드되지 않았기 때문입니다. Bundler가 내가 예상하지 못한 보석으로 무언가를했기 때문에 그 일이 일어날 때를 발견했습니다. – pjmorse
내 티켓 @pjmorse를 업데이트했습니다. – Leder
좋아요, 네, Gemfile이 아닙니다. – pjmorse