Following the documentation, everything progressed smoothly: signing up, installing Heroku Toolbelt, initial login, creating the cedar stack and the final push — except asset compilation. By default, Heroku continues even if asset compilation fails. So always read the output carefully:
$ git push heroku master ... -----> Heroku receiving push -----> Ruby/Rails app detected -----> Installing dependencies using Bundler version 1.1.2 ... -----> Writing config/database.yml to read from DATABASE_URL -----> Preparing app for Rails asset pipeline Running: rake assets:precompile rake aborted! could not connect to server: Connection refused Is the server running on host "127.0.0.1" and accepting TCP/IP connections on port 5432? Tasks: TOP => environment (See full trace by running task with --trace) Precompiling assets failed, enabling runtime asset compilation Injecting rails31_enable_runtime_asset_compilation Please see this article for troubleshooting help: http://devcenter.heroku.com/articles/rails31_heroku_cedar#troubleshooting -----> Rails plugin injection ...
One simple way around an asset compilation issue is to:
- Compile locally
$ bundle exec rake assets:precompile
- Commit assets to git
$ git add -f public/assets/ $ git commit -m "Precompile public assets"
$ git push -f heroku master
And — after
heroku run rake db:migrate — everything's great
-----> Writing config/database.yml to read from DATABASE_URL -----> Preparing app for Rails asset pipeline Detected manifest.yml, assuming assets were compiled locally -----> Rails plugin injection
or at least for me...