سؤال

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.rb in 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_san to add a post deploy hook of heroku run rake assets:precompile

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top