Deployed rails app with Cloud 66, to digitalocean.com. Everything works fine, except some permission errors when trying to upload images.
Errno::EACCES (Permission denied - /var/deploy/anabol/web_head/releases/20130608104347/public/uploads/tmp):
image_uploader.rb
class ImageUploader < CarrierWave::Uploader::Base
...
def store_dir
"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end
...
end
There is a description, how to solve the problem here: https://www.cloud66.com/help/permission_denied_errors
I changed the store_dir path to:
def store_dir
"#{Rails.root}/tmp/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end
But it didn't help. I still get this error:
» 13:49:25.696 Errno::EACCES (Permission denied - /var/deploy/anabol/web_head/releases/20130608114659/public/uploads/tmp):
Am I missing something?
Edit:
Upload works with this part in image_uploader.rb:
def cache_dir
# should return path to cache dir
Rails.root.join 'tmp/uploads/cache'
end
def store_dir
"#{Rails.root}/tmp/uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end
But now I get:
ActionController::RoutingError (No route matches [GET] "/var/deploy/anabol/web_head/releases/20130608164223/tmp/uploads/profile/image/3/thumb_Screenshot_from_2013-06-05_17_27_54.png"):
On the view, only the images path is displayed.