我决定将我的应用程序部署到 Heroku 并且我正在关注他们的教程。但是,我现在尝试使用回形针插件连接到我的 Amazon S3 存储桶,但出现此错误:
图片中的参数错误#index
显示第 19 行出现的 app/views/images/index.html.erb:
第 0 行第 39 列的语法错误:`bucket: (MY BUCKET HERE)
access_key_id: (MY ACCESS KEY ID HERE)
secret_access_key: (MY SECRET ACCESS KEY HERE)
'
提取的源代码(在第 19 行附近):16: <%=h image.created_at %>
17: <%=h image.updated_at %>
18:
19: <% if image.img.exists? 然后 %>
20:<%= image_tag image.img.url(:thumb) %>
21: <% 其他 %>
22:没有附照片,上传一张。
RAILS_ROOT: C:/Users/Mariusz/Sites/wiw_development
应用程序跟踪 | 框架跟踪 | 完整跟踪
C:/Ruby/lib/ruby/1.8/yaml.rb:133:in load' C:/Users/Mariusz/Sites/wiw_development/vendor/plugins/paperclip/lib/paperclip/storage.rb:236:in parse_credentials' C:/Users/Mariusz/Sites/wiw_development/vendor/plugins/paperclip/lib/paperclip/storage.rb:138:in instance_eval' C:/Users/Mariusz/Sites/wiw_development/vendor/plugins/paperclip/lib /paperclip/storage.rb:137:in扩展' C:/Users/Mariusz/Sites/wiw_development/vendor/plugins/paperclip/lib/paperclip/attachment.rb:269:in初始化' C:/Users/Mariusz/Sites /wiw_development/vendor/plugins/paperclip/lib/paperclip.rb:326:in attachment_for'load'
C:/Ruby/lib/ruby/1.8/yaml.rb:133:infind_credentials'
C:/Users/Mariusz/Sites/wiw_development/vendor/plugins/paperclip/lib/paperclip/storage.rb:176:inextended'
C:/Users/Mariusz/Sites/wiw_development/vendor/plugins/paperclip/lib/paperclip/storage.rb:137:inextended'
C:/Users/Mariusz/Sites/wiw_development/vendor/plugins/paperclip/lib/paperclip/attachment.rb:269:ininitialize_storage'
C:/Users/Mariusz/Sites/wiw_development/vendor/plugins/paperclip/lib/paperclip/attachment.rb:51:innew'
C:/Users/Mariusz/Sites/wiw_development/vendor/plugins/paperclip/lib/paperclip.rb:326:in
C:/Users/Mariusz/Sites/wiw_development/vendor/plugins/paperclip/lib/paperclip.rb:229:in _run_erb_app47views47images47index46html46erb' C:/Users/Mariusz/Sites/wiw_development/app/views/images/index.html.erb :12:in _run_erb_app47views47images47index46html46erb' C:/Users/Mariusz/Sites/wiw_development/app/controllers/images_controller.rb:7:in `index'img'
C:/Users/Mariusz/Sites/wiw_development/app/views/images/index.html.erb:19:ineach'
C:/Users/Mariusz/Sites/wiw_development/app/views/images/index.html.erb:12:in
我的文件如下所示:
1) 应用程序/模型/image.rb
类图像 < ActiveRecord::Base
has_and_belongs_to_many :pairs
validates_presence_of :img_file_name
has_attached_file :img, :styles => {:thumb=> "100x100#", :page => "400x320>"}, :storage => :s3, :s3_credentials => "#{RAILS_ROOT}/config/s3.yml"
结束
2) 配置/s3.yml
桶:(我的桶在这里)
access_key_id:(我的访问密钥ID在这里)
secret_access_key:(我的秘密访问密钥)
我怎样才能让它工作?