Report this

What is the reason for this report?

Dokku Rails app unable to interact with Block Storage [Errno::EACCES (Permission denied)]

Posted on May 8, 2017

I have a rails app where users are able to upload an avatar image via Ruby’s Paperclip gem.

In terms of paperclip’s configurations, I have the following set:

For my model: has_attached_file :avatar, path: “/mnt/volume-sgp1-01/:class/:attachment/:id/:style/:filename”

For paperclip environment configurations: config.paperclip_defaults = { url: ‘/mnt/volume-sgp1-01/:class/:attachment/:id/:style/:filename’ }

Hypothetically, this should work. However, when the upload starts, I get the following error message.

Errno::EACCES (Permission denied @ dir_s_mkdir - /mnt/volume-sgp1-01)

Also, once permission is granted, how can I make sure that it is automatically linked to a corresponding url direction in my rails app? (ex: xyz.com/mnt/volume-sgp1-01/…)

Thanks!

I have read the Digital Ocean documentation on block storage, but I feel the documentation is missing a lot of important details on actually integrating it with a Ruby on Rails application.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.