Shalafister's
Shalafister's

Reputation: 881

Pushing Rails app to Heroku seeing no difference on asset files

I have searched over the web & stackoverflow about this topic but could not find a comprehensive guide even in heroku's web site.

I have a rails app and when I push the app to heroku here are the steps I am following;

  1. rake assets:clobber
  2. bundle exec rake assets:precompile RAILS_ENV=production
  3. git init
  4. git add .
  5. git commit -m "message"
  6. git push heroku master

Voila!, but then when I make changes in js and/or css files, I start again from number 1 deleting assets then precompile etc as I mentioned. But sometimes I can not see the differences I make on heroku. When I destroy the heroku app and push again there I see.

I am wondering, whether I have to clean Heroku assets as well like rake assets:clobber.

Some people say that when you push to Heroku, it resets asset files automatically but then what is the reason sometimes I can not see the differences.

When committing to git git commit -m "message" do you think this message part must be unique?, maybe when commit with the same message, they create a conflict ?

Thank you

Upvotes: 0

Views: 66

Answers (2)

Yimanei
Yimanei

Reputation: 242

Make sure that you don't use a CDN and try this:

  • bundle exec rake assets:precompile RAILS_ENV=production
  • git add -A
  • git commit -m "message"
  • git push
  • git push heroku master

Upvotes: 1

chintanparikh
chintanparikh

Reputation: 1682

Try deleting public/assets and pushing to Heroku. Heroku should then take care of pre-compiling, etc for you.

When people say Heroku takes care of it for you, they ONLY take care of it if you don't have a public/assets folder.

Upvotes: 0

Related Questions