carrierwave

howto: Basic setup of carrierwave [Heroku and S3]

感情迁移 提交于 2020-01-12 08:04:29
问题 I have an S3 bucket for production and development. I have done my research and came across this post but my current config does not work as expected. I get the following exception (below) locally and I get no file uploads to my S3 bucket from my heroku app: is not a recognized storage provider Extracted source (around line #3): 1: 2: <p><%= user.name %></p> 3: <%= image_tag user.avatar.url %> 4: <%= link_to 'Show', user %> 5: <%= link_to 'Edit', edit_user_path(user) %> 6: <%= link_to

CKEditor Carrierwave Cloudinary

流过昼夜 提交于 2020-01-11 03:24:17
问题 I'm trying to get CKEditor to work with Carrierwave and Cloudinary. So far, non-CKEditor enabled views with a regular file upload field are working perfectly with Carrierwave & Cloudinary. However, when I try to upload a file in CKEditor and "Send it to the Server" I'm getting a NoMethodError - undefined method 'each' for "image/jpeg":String: Prior to removing the local storage config from the CKEditor classes it was working, but saving the file locally. Here is my current CKEditor uploader:

CKEditor Carrierwave Cloudinary

你说的曾经没有我的故事 提交于 2020-01-11 03:24:06
问题 I'm trying to get CKEditor to work with Carrierwave and Cloudinary. So far, non-CKEditor enabled views with a regular file upload field are working perfectly with Carrierwave & Cloudinary. However, when I try to upload a file in CKEditor and "Send it to the Server" I'm getting a NoMethodError - undefined method 'each' for "image/jpeg":String: Prior to removing the local storage config from the CKEditor classes it was working, but saving the file locally. Here is my current CKEditor uploader:

How to stub carrierwave in Rspec?

人盡茶涼 提交于 2020-01-11 00:07:28
问题 I want to stub carrierwave to prevent it from fetch images on the web during my tests. How would I stub things to achieve this? My crawler parses a remote web page, and saves one image url into the model. Carrierwave will fetch that image automatically during the save operation. It works well. However I have a test about the parsing of pages, and every-time it will download the file, which slows down the testing. UPDATE: I mount the uploader as the following (in the pre-existing paperclip

Schema.rb display Could not dump table “progresses” because of following NoMethodError # undefined method `[]' for nil:NilClass

送分小仙女□ 提交于 2020-01-07 02:52:09
问题 I am trying to add a multiple image uploader with Carrierwave following the documentation to my app. Normally my schema.rb looks like this ActiveRecord::Schema.define(version: 20160814232416) do create_table "progresses", force: :cascade do |t| t.string "title" t.string "date" t.text "content" t.datetime "created_at", null: false t.datetime "updated_at", null: false end end And when I run : rails g migration add_images_to_progresses images:json and rake db:migrate My schema change and display

Invalid encoding with rqrcode

不问归期 提交于 2020-01-05 08:47:15
问题 I'm having an invalid encoding error that doesn't let me save the image to a carrierwave uploader. require 'rqrcode_png' img = RQRCode::QRCode.new( 'test', :size => 4, :level => :h ).to_img.to_s img.valid_encoding? => false 回答1: I'm not sure if this is what you're looking for, in my case I needed to associate the generated QR code with a Rails model using carrierwave, what I ended up doing was saving the image to a temp file, associating that file with the model and afterwards deleting the

Why does carrierwave cause the NameError: uninitialized constant Micropost::PictureUploader error?

为君一笑 提交于 2020-01-03 19:17:18
问题 In the Hartl Rails tutorial chapter 13.4.1 Basic image upload we add the carrierwave gem for image uploads. But, I kept getting this error in my tests after generating the uploader and adding the migration to the Microposts model: NameError: uninitialized constant Micropost::PictureUploader After googling around I was able to fix this by adding this to my environments.rb : require 'carrierwave/orm/activerecord' But I feel like I'm doing something wrong because Hartl does not do this and he

Unable to verify certificate - please set 'ENV['SSL_CERT_FILE'] = path_to_file'

余生长醉 提交于 2020-01-03 08:24:27
问题 I have a Rails 4 application that uses Carrierwave to upload files. After installing Fog to upload files to Amazon 3, I started getting the following error when uploading files: Excon::Errors::SocketError in VideosController#create Unable to verify certificate, please set `Excon.defaults[:ssl_ca_path] = path_to_certs`, `ENV['SSL_CERT_DIR'] = path_to_certs`, `Excon.defaults[:ssl_ca_file] = path_to_file`, `ENV['SSL_CERT_FILE'] = path_to_file`, `Excon.defaults[:ssl_verify_callback] = callback`

Carrierwave Gem: After creating user with avatar, 'cannot convert nil into string'

。_饼干妹妹 提交于 2020-01-03 04:54:08
问题 I will say when I first got carrierwave up and running, everything was working totally fine aside from the size scaling of the avatar. So now after I tried to do scaling, everything went to hell. I uninstalled the gem, did a migration to remove avatar from user, then did another migration to add. Still the same error. Note I am doing rails g uploader Avatar, NOT image. I have not touched the avatar_uploader.rb file, aside from adding require 'carrierwave/orm/activerecord' on the top line. So,

Carrierwave processed images not uploading to AWS S3

两盒软妹~` 提交于 2020-01-03 03:43:12
问题 Similar problem to this question but the solution provided did not fix my problem. Carrierwave processed images not uploading to S3 Using Railscast #383 as basis for code: http://railscasts.com/episodes/383-uploading-to-amazon-s3 The image is successfully uploaded to S3 using carrierwave_direct. I want to process the images in the background with sidekiq and then upload to S3. The sidekiq worker completes the image processing without error but the processed images (:thumb and :large) are