I'm pushing changes to Heroku and I get ...
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?
When I consult the Heroku documentation Here, it tells me I need to "configure a nonexistent database in your local config/database.yml" I'm not sure how to create a "nonexistent database"? I'm a beginner and would appreciate any help you can give me. Thanks.
To compile your assets locally, run the assets:precompile task locally on your app. Make sure to use the production environment so that the production version of your assets are generated. A public/assets directory will be created. Inside this directory you'll find a manifest.
1 What is the Asset Pipeline? The asset pipeline provides a framework to concatenate and minify or compress JavaScript and CSS assets. It also adds the ability to write these assets in other languages and pre-processors such as CoffeeScript, Sass, and ERB.
rake assets:clean Only removes old assets (keeps the most recent 3 copies) from public/assets . Useful when doing rolling deploys that may still be serving old assets while the new ones are being compiled.
Sprockets is a crucial Ruby library that is used to serve and compile web assets. However, in Rails 7.0 the library becomes an optional dependency unless the application needs to use Sprockets. In such situations, the sprockets-rails gem will have to be added to the Gemfile .
On Heroku, you must set this line in your config/application.rb:
config.assets.initialize_on_precompile = false
http://guides.rubyonrails.org/asset_pipeline.html#precompiling-assets
For faster asset precompiles, you can partially load your application by setting config.assets.initialize_on_precompile to false in config/application.rb, though in that case templates cannot see application objects or methods. Heroku requires this to be false.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With