Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing required option :name when trying to use S3 for storage. #35

Open
jfacoustic opened this issue Jan 24, 2019 · 2 comments
Open

Comments

@jfacoustic
Copy link

jfacoustic commented Jan 24, 2019

I've been trying to get my blog set up on Heroku in S3. I followed issue #16, but this is as far as I got.
I've also been following Heroku's instructions for setting up Rails with S3.

I was testing this with heroku local:run rails s to get the error.
I tried pushing to my website and it didn't work either.

ArgumentError in Lines::Articles#index
missing required option :name

  <div class="article <%= article_class %>">
  <% cache "#{article_small}_small" do %>
    <% unless article_small.image_url.blank? %> #This is where the error is marked.
      <div class="hero_image">
        <%= link_to article_path(article_small) do %>
          <img src="<%= article_small.image_url %>" alt="<%= article_small.title %>" />

The top of my framework trace says
aws-sdk-s3 (1.30.1) lib/aws-sdk-s3/bucket.rb:684:in extract_name

Thanks for your help :)

@adonespitogo
Copy link
Contributor

adonespitogo commented Jan 24, 2019

Install byebug gem and put a debugger statement above the line that gives error. Then press n in the console to follow where the :name is required for.

@jeremykirc
Copy link

jeremykirc commented Aug 12, 2021

You need to provide a bucket name. I was able to get this working with the following config in an initializer:

CarrierWave.configure do |config|
  config.aws_bucket =  ENV['AWS_BUCKET']
  config.aws_credentials = {
    access_key_id:     ENV['AWS_ACCESS_KEY_ID'],
    secret_access_key: ENV['AWS_SECRET_ACCESS_KEY'],
    region:            'us-west-1'
  }
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants