Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work on Heroku by default #12

Open
asgeo1 opened this issue Feb 14, 2014 · 2 comments
Open

Doesn't work on Heroku by default #12

asgeo1 opened this issue Feb 14, 2014 · 2 comments

Comments

@asgeo1
Copy link

asgeo1 commented Feb 14, 2014

To get working on Heroku, I had to set the :path in the call to has_attached_file like so:

has_attached_file :avatar,
  :styles => { :medium => '300x280>' },
  :storage => :database,
  :path => ':rails_root/public/system/:class/:attachment/:id_partition/:style/:filename'

It took me a little bit to work that out, as it wasn't really obvious what the issue was. The image would actually upload successfully, and the binary would appear in the image table - but the file_name and content_type properties would be empty so the image couldn't be retrieved via paperclip.

What's weird, is that ":rails_root/public/system/:class/:attachment/:id_partition/:style/:filename" is meant to be the default value for the :path setting anyway according to the paperclip documentation.

Is this something that needs to be fixed in paperclip_database?

If not, maybe add a note about setting the :path to the README?

@jarl-dk
Copy link
Member

jarl-dk commented Feb 20, 2014

Thanks for reporting this problem.
What version of Rails and what version of paperclip is this seen on?

@willsteinmetz
Copy link

I'm running into this right now. My versions are:

  • Rails: 4.2.1
  • Paperclip: 4.3.0
  • Paperclip database: 2.3.1

What's strange is that this all worked fine until I had to wipe my computer. All of the gems and libraries that are listed for both Paperclip and Paperclip database are installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants