4

Heroku suddenly stopped working and gave me this error:

  could not connect to server: Connection refused
  Is the server running on host "127.0.0.1" and accepting
  Precompiling assets failed.

After some research I ran this line:

 running RAILS_ENV=production bundle exec rake assets:precompile

This worked but now when i push an update to heroku the new css doesn't load. This line never used to show before:

Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --deployment

If possible can you also explain why the assets:precompile line solved my original problem?

4
  • Read: guides.rubyonrails.org/asset_pipeline.html#precompiling-assets this will answer your question reason why you should precompile your assets. But that particular command runs it in production mode using the exec command. Also when you say the new CSS won't update what is the error in the console you are getting. Post this Commented Oct 30, 2013 at 23:48
  • Thanks for the link, that helped me understand it a bit more. There is no error when pushing to heroku it's just that any new css doesn't load. Commented Oct 30, 2013 at 23:52
  • At which point when you try to load the page, open firebug or chrome dev tools and go to the console. You should have some sort of output Commented Oct 30, 2013 at 23:55
  • Hmm, the chrome devs console just shows some info about fonts. Commented Oct 31, 2013 at 0:11

1 Answer 1

10

Run this commands:

 bundle exec rake tmp:clear

 bundle exec rake assets:clean RAILS_ENV=production

 bundle exec rake assets:precompile RAILS_ENV=production

Hope this helps!

Sign up to request clarification or add additional context in comments.

1 Comment

All it took was bundle exec rake assets:clean RAILS_ENV=production for it to work. Thanks for the help!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.