I have a Rails 3.1 application with an usual file layout. Heroku detects it as Ruby/Rack rather than Ruby/Rails. assets:precompile isn’t run, so pages that require them fail with a javascript error.
What do I need in my file structure to trick Heroku into running the precompile task? Or, can I configure a command to run during slug compilation?
Do you have have a
config/application.rbin your codebase? This is what the Heroku ruby buildpack uses to detect that it’s Rails 3, so it sounds to me like this could be missing.Once Heroku detects that it’s Rails it’ll run the
rake assets:precompile.Failing that, you could use a gem such as
heroku_santo add a post deploy hook ofheroku run rake assets:precompile