carrierwave

Uploads silently failing/pausing with new carrierwave_direct gem when uploading to s3

穿精又带淫゛_ 提交于 2019-12-11 17:14:29
问题 i am having a small problem uploading files to s3 with new carrierwave_direct gem I have followed the instructions for installing and setting up carrierwave_direct, however when i try to upload to s3, the upload begins and then pauses the upload at some point. Any thoughts? Also sometimes i get this message from s3: <Error> <Code>InvalidPolicyDocument</Code> <Message> Invalid Policy: Invalid 'expiration' value: '2011-09-13T07:52:58+02:00' </Message> <RequestId>"some id"</RequestId> <HostId>

Carrierwave Problem - Files not showing?

青春壹個敷衍的年華 提交于 2019-12-11 16:49:50
问题 <% @company.comments.each do |comment| %> <tr> <td><%= comment.commenter %></td> <td><%= comment.body %></td> <td><%= time_ago_in_words(comment.created_at, "Comment") %> ago</td> <td><%= comment.commentfile %></td> </tr> <% end %> Is where i am trying to display the uploaded file from the form below: <h2>Add a comment:</h2> <%= form_for([@company, @company.comments.build]) do |f| %> <div class="hidden"> Name:<br /> <%= f.text_field :commenter, :value => current_user.full_name, :readonly =>

CarrierWave default_url not triggering

被刻印的时光 ゝ 提交于 2019-12-11 16:29:31
问题 I'm having a hard time getting this to work. Right now I'm using the image_tag helper on my view pages. If there isn't an image loaded, I need it to use the fallback from Carrierwave instead of just throwing an error. For my setup I'm using fog for storage, I feel like that might be part of the problem. def default_url asset_path("fallback/default.jpg") end Does Carrierwave just find any image that isn't set? Or is there some special way I'm supposed to grab the image url for it to work? This

cannot split': bad URI(is not URI?):

独自空忆成欢 提交于 2019-12-11 15:46:54
问题 I've got the following CarrierWave initializer which works fine on my Heroku/MONGOHQ/GridFS env : CarrierWave.configure do |config| config.storage = :grid_fs uri = URI.parse(ENV['MONGOHQ_URL']) config.grid_fs_database = File.basename(uri.path) config.grid_fs_host = uri.host unless uri.host.blank? config.grid_fs_port = uri.port unless uri.port.blank? config.grid_fs_username = uri.user unless uri.user.blank? config.grid_fs_password = uri.password unless uri.password.blank? config.grid_fs_access

CarrierWave not resizing

梦想的初衷 提交于 2019-12-11 14:14:09
问题 I'm using carrierwave with ImageSorcery in order to handle image uploads and thumbs creation. Everything worked really well until I realized my thumbs were saved without being resized =/ I don't know what causes this and didn't find any solution working for me on the interwebs. I'm using Ruby 2.0.0p247 and here's my code : source 'https://rubygems.org' gem 'thin' gem 'rails', '4.0.0' gem 'sqlite3' gem 'sass-rails', '~> 4.0.0' gem 'uglifier', '>= 1.3.0' gem 'jquery-rails' gem 'fancybox2-rails'

Reading uploaded image: undefined method `file' for nil:NilClass

守給你的承諾、 提交于 2019-12-11 13:51:30
问题 I receive the following error when I try to get image during thumbnail creation: undefined method `file' for nil:NilClass My code: version :thumb do img = ::Magick::Image::read(@file.file).first w = img.columns h = img.rows if w < h process :resize_to_limit => [30, 50] else process :resize_to_limit => [50, 30] end end Any ideas what is this not working? 来源: https://stackoverflow.com/questions/24363366/reading-uploaded-image-undefined-method-file-for-nilnilclass

Cannot get my Articles controller to create a blog Article with a picture. I am using imagemagick and carrierwave

跟風遠走 提交于 2019-12-11 10:31:30
问题 My create action in ArticlesController seems fine if I create an Article without uploading a picture. However, if I try to upload a picture for an article, I get the error: ActionController::UrlGenerationError in ArticlesController#create No route matches {:action=>"show", :controller=>"articles", :id=>nil} missing required keys: [:id] Here is my Articles controller: class ArticlesController < ApplicationController before_filter :require_login, only: [:new, :create, :edit, :update, :destroy]

Carrierwave_Direct's direct_upload_form_for returns undefined method `model_name' for FileUploader:Class

て烟熏妆下的殇ゞ 提交于 2019-12-11 08:35:24
问题 I've been struggling with this for a couple of hours now. When using carrierwave_direct's direct_upload_form_for in my view, it returns me this error: FileUploader Carrierwave Class: class FileUploader < CarrierWave::Uploader::Base include CarrierWaveDirect::Uploader end ManualFile Model: class ManualFile include Mongoid::Document mount_uploader :file, FileUploader field :name, :type => String end UploadController: class UploadController < ApplicationController def manual_new @uploader =

rake aborted! Operation not permitted - Carrierwave Delete tmp files that failed validation

社会主义新天地 提交于 2019-12-11 07:22:27
问题 I am using Carrierwave, s3 and fog to upload videos. I added in a file_size_validator file so that videos can't be larger than 5mb. My understanding of how Carrierwave works (please advise if incorrect). Carrierwave saves a copy of the file to the tmp file folder and then performs validations on it so if it passes, the file is uploaded to S3 and the code below removes the tmp file from the local filesystem: video_uploader.rb before :store, :remember_cache_id after :store, :delete_tmp_dir def

CarrierWave save NULL at file column

◇◆丶佛笑我妖孽 提交于 2019-12-11 06:39:16
问题 im using model called Photo that references Uploader class.. class Photo < ActiveRecord::Base attr_accessible :title, :album_id belongs_to :album mount_uploader :photo_image, PhotosUploader end class Album < ActiveRecord::Base attr_accessible :title, :autor, :photos_attributes has_many :photos, :dependent => :destroy accepts_nested_attributes_for :photos end but.. when i try to save new Album (or edit, whatever..) with image it not save a file (the collumn photo_image is saved as NULL and