Heroku provides PaaS in the cloud, and is well known as a host for Rails apps. Last week, my first opportunity arrived to find out whether Heroku is as good as they say. I wasn't disappointed.
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"
- Push
$ 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...
No comments:
Post a comment