Open abatko opened 11 years ago
This is a Heroku problem. When you don't have serve static assets set, heroku installs a plugin to do that. Regardless of your asset host I believe.
With your app then being a stripped down app the middleware stack is not what heroku is expecting. Causing the error.
One thing would be to upgrade to rails 4. As vendor/plugins is deprecated, heroku doesn't install the plugin.
A friend of mine, working on a different app, but with a similar setup (ruby 1.9.3
, rails 3.2.13
, asset_sync 1.0.0
, no local public/assets
directory) has config.serve_static_assets = false
and uploads work without fail. How can that be?
The same issue just appeared for me recently on rails-4.0.1
. Any insight on what was causing this?
I'm getting this on Rails 4.0.4 today.
For people that are reporting failures that others cannot reproduce, do you have heroku-deflater in your Gemfile? Removing it got rid of the error for me.
No heroku-deflater
in my projects.
I believe heroku-deflater caused this problem, but even after removing it from my Gemfile, the issue persists.
Make sure you have gem 'rails_12factor', group: :production
.
That solved the problem for me.
I have a barebones Rails app (with just a blank root/home page).
As far as I know I have configured the app correctly for
asset_sync
:gem 'asset_sync', '~> 1.0.0'
in:assets
group inGemfile
config.action_controller.asset_host = "//#{ENV['FOG_DIRECTORY']}.s3.amazonaws.com"
instaging.rb
(because I am trying this instaging
prior toproduction
)config.assets.digest = true
instaging.rb
config.assets.enabled = true
inapplication.rb
AWS_ACCESS_KEY_ID
,AWS_SECRET_ACCESS_KEY
,FOG_PROVIDER
,FOG_DIRECTORY
,FOG_REGION
user-env-compile
enabled on HerokuAdditionally, I tested that all this works locally:
Following this test, I delete the
assets
folder on both S3 and in my localpublic
folder.When I push to Heroku, I get this failure:
Whereas when I set
config.serve_static_assets = true
instaging.rb
the push succeeds (and assets are uploaded as expected):Any idea what may be wrong?