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!
Accepted Answer
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.
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 have chmod
to a setting allowing for read and write.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.