Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to work with rack using ruby for storing image on cloudinary with gem carrierwave

I am using rack framework with active record and there is no rails , so when i upload an image to cloudinary using carrierwave gem i am getting the following error.

Unexpected error while processing request: uninitialized constant Cloudinary::CarrierWave::Storage::Rails

like image 850
Ashish mittal Avatar asked Nov 29 '25 12:11

Ashish mittal


2 Answers

That was a bug in cloudinary gem, now this has been solved by Cloudinary team.

Please refer to this #Issue-154

Hope it helps.

like image 50
Ashish mittal Avatar answered Dec 02 '25 05:12

Ashish mittal


Based off of this ,you can't use carrierwave gem without rails. You should be able to do something like:

you can use meta-programming in ruby.

Just override the class of Carrierwave and create a storage.rb file :

Cloudinary::CarrierWave::Storage.class_eval do
 /// Your code here...
end
like image 26
Ankit Pandey Avatar answered Dec 02 '25 04:12

Ankit Pandey



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!