opoloo / lines-engine

Lines is a customizable blog framework for Rails. It aims at making publishing simple and beautiful.
http://lines.opoloo.com
GNU Lesser General Public License v3.0
216 stars 102 forks source link

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

Open jfacoustic opened 5 years ago

jfacoustic commented 5 years ago

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 commented 5 years ago

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 commented 3 years ago

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