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.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
After posting up a similar question on Stack Overflow, I was guided by a dokku user to this plugin which is native to Dokku and should solve all these problems.
Documentation about using Persistent Storage on Dokku
Hi @sergiorivasf40c7ff6ddb06ce I would recommend that you hire a system administrator to setup and maintain your server. I know @jtittle is an excellent administrator and you can contact him if you want: https://www.digitalocean.com/community/users/jtittle
Hi @sergiorivasf40c7ff6ddb06ce
I don’t know anything about Dokku Rails, but the Block Storage works just like any other mount point (like another disk connected to the server), so you shouldn’t have to do anything other that making sure the directory is
chown
by the correct user/group and havechmod
to a setting allowing for read and write.