Geoffrey Hug Geoffrey Hug - 1 year ago 62
Apache Configuration Question

Impossible to serve generated images without restarting app with Rails + Passenger?

I have images that are generated by users and written to


I have

config.serve_static_files = true
config.assets.compile = true

I have

Rails.application.config.assets.paths << Rails.root.join('public', 'designer', 'designer_output')

Yet I can't access the files either by requesting

If I restart the server then the files become available only via the
path. But I need them to be available as soon as they are created without restarting.

If find it odd that I can't access them through the public folder at all.

This is on Rails 4.2.6 with Apache/Passenger

Also I have carrierwave as an upload gem, and it is storing files in public/uploads folder and that works fine.

max max
Answer Source

The public folder is used as the web root for the rails server. You need to drop public in the path or URL:

<!-- file is at /public/foo/bar.png --!>
<img src="/foo/bar.png" />
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download