0

Everything was working perfectly but after I published the website on Heroku and tried to continue development on localhost, CSS is not taking effect anymore.

What cache settings do I need to modify?

2.7.1 :002 > Rails.env.development?
 => false 
2.7.1 :003 > Rails.env.test?
 => true 
2.7.1 :004 > Rails.env.production?
 => false 
2.7.1 :005 > Rails.env
 => "test" 
$ rails s

Rails 6.0.3.4 application starting in development 
=> Run `rails server --help` for more startup options
Puma starting in single mode...
* Version 4.3.7 (ruby 2.7.1-p83), codename: Mysterious Traveller
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://127.0.0.1:3000
* Listening on tcp://[::1]:3000
Use Ctrl-C to stop

Clearing the cache works temporarily

$ rake tmp:cache:clear

Edit

I have tried all the solutions suggested here, here and the ruby-on-rails docs but no luck.

axelmukwena
  • 779
  • 7
  • 24

1 Answers1

1

When you deploy to Heroku the asset pipeline will compile the assets and put them in the public directory.

Try deleting the public/assets/ directory in your project.

If that doesn't work try restarting your server and clearing the browser's cache.

tywhang
  • 299
  • 4
  • 5
  • Mu public directory does not contain `/assets`, only `/packs` and some static files. Either, when I refresh and restart everything just gets recompiled. My temporary resolution now is just to reclone my repository before Heroku or create an exact copy and then copy-paste changes to the published site, and rake cache. – axelmukwena Feb 06 '21 at 02:44