Note that there are some explanatory texts on larger screens.

plurals
  1. POruby paperclip to s3 error
    primarykey
    data
    text
    <p>I'm trying to use paperclip with heroku and s3, but I have many tables that can be associated with photos, we'll use :review for example. I'm trying to seperate the photo from the review and upload that seperately, but since I'm new to ruby, I think I'm failing miserably. I have the 'aws-s3' gem installed and bundled.</p> <p>This is the error I'm getting:</p> <pre><code>LoadError in ReviewsController#create no such file to load -- aws/s3 (You may need to install the aws-s3 gem) Rails.root: C:/www/devise Application Trace | Framework Trace | Full Trace app/controllers/reviews_controller.rb:56:in `new' app/controllers/reviews_controller.rb:56:in `block in create' app/controllers/reviews_controller.rb:54:in `create' app/controllers/redirect_back.rb:23:in `store_location' This error occurred while loading the following files: aws/s3 </code></pre> <p>photo Model:</p> <pre><code>class Photo &lt; ActiveRecord::Base belongs_to :user belongs_to :shop belongs_to :baristum belongs_to :review #paperclip has_attached_file :photo, :styles =&gt; { :thumb=&gt; "100x100#", :small =&gt; "400x400&gt;", :original =&gt; "800x800" }, :storage =&gt; :s3, :s3_credentials =&gt; "#{RAILS_ROOT}/config/s3.yml", :path =&gt; "/:style/:id/:filename" end </code></pre> <p>photo schema:</p> <pre><code>t.string "file_name" t.string "content_type" t.integer "file_size" t.integer "user_id" t.integer "barista_id" t.integer "review_id" t.integer "shop_id" t.datetime "created_at" t.datetime "updated_at" </code></pre> <p>review Controller:</p> <pre><code>def create #add the current user to the review hash, from the session var. params[:review][:user_id] = current_user.id #move the photo to another var, so I can remove it from the review insert @photoUpload = params[:review][:photo] params[:review].delete("photo") @review = Review.new(params[:review]) respond_to do |format| if @review.save @photo = Photo.new(:photo =&gt; @photoUpload, :review_id =&gt; @review.id) @photo.save format.html { redirect_to(@review, :notice =&gt; 'Review was successfully created.') } format.xml { render :xml =&gt; @review, :status =&gt; :created, :location =&gt; @review } else @shopList = Shop.find(:all) format.html { render :action =&gt; "new" } format.xml { render :xml =&gt; @review.errors, :status =&gt; :unprocessable_entity } end end end </code></pre> <p>gemfile</p> <pre><code>source 'http://rubygems.org' gem 'pg' gem 'rake', '~&gt; 0.8.7' gem 'rails', '3.0.5' #gem 'sqlite3-ruby', :require =&gt; 'sqlite3' gem 'devise', :git =&gt; 'git://github.com/plataformatec/devise', :branch =&gt; 'master' gem 'omniauth', '0.2.0' gem 'paperclip' #gem 'RMagick' gem "simple_form", "~&gt; 1.2.2" gem 'twitter_oauth', '0.4.3' gem "rest-client", "1.6.1", :require =&gt; "restclient" gem "sluggable" gem 'gmaps4rails' gem 'exception_notification', :require =&gt; 'exception_notifier' gem 'yaml_db' #gem 'mysql' gem 'aws-s3' #gem 'carrierwave' #gem 'fog' #amazon s3 #gem 'nokogiri' group :development, :test do gem 'rspec-rails' gem 'fixjour' end </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload