anjlab / bootstrap-rails

Twitter Bootstrap CSS (with Sass flavour) and JS toolkits for Rails 3 projects
https://github.com/anjlab/bootstrap-rails
729 stars 96 forks source link

Deploy to Heroku #21

Closed mjc-gh closed 12 years ago

mjc-gh commented 12 years ago

Get the following error when deploying to Heroku. My Gemfile entry is outside of the :asset groups

 -----> 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
yury commented 12 years ago

try to add config.assets.initialize_on_precompile = false in your application.rb

mjc-gh commented 12 years ago

That worked. Thanks!

adammacleod commented 10 years ago

I also had this problem and had no luck with initialize_on_precompile. The fix for me was to add the rails_12factor gem to my Gemfile as Heroku suggests.

group :production, :staging do
  gem 'rails_12factor'
end