views:

5

answers:

0

I'm on Heroku, and this is a portfolio thing which I'm putting up on github for potential employers to look at, so obviously I don't want to stick my keys in a S3.yml file. I've exported S3_KEY and S3_SECRET to my environment both on Heroku and my machine and ruby can access them. But when I try and upload, it gives me the following error:

AWS::S3::MissingAccessKey in Portfolio itemsController#update

You did not provide both required access keys. Please provide the access_key_id and the secret_access_key.

The trace is irrelevant except for my controller line #, which works fine until I try and upload a file. Here's what I have:

class Asset < ActiveRecord::Base
  attr_accessible :image, :image_file_name, :image_content_type, :image_file_size, :portfolio_item_id, :order

  has_attached_file :image,
    :styles => {
      :thumb => "100x100#",
      :small => "300x300",
      :large => "600x600>"
               },
    :storage => :s3,
    :s3_credentials => {
      :access_key_id => ENV["S3_KEY"],
      :secret_access_key => ENV["S3_SECRET"]
                       },
    :bucket => "bucketybucket",
    :path => "portfolio"

end

Anyone know what's going on here? How am I constructing this hash wrong?

Oh, and I've followed this thread, no dice: http://stackoverflow.com/questions/3019411/paperclip-and-amazon-s3-issue