CSS not rendering in Ruby on Rails [Development Notes]

When Ruby on Rails does not render CSS and Images look disproportionate on Linux Ubuntu Destro (Windows Subsystem) try the following below:


  1. Make sure no other apps like VS Code or Git Client are using the same [Web App directory] where the website is located because one process can lock the other. 
  2. Before running any commands in your project directory using your favourite Console App (e.g. Powershell, CMD, Bash etc), Open up Development Tools and navigate to Network Tab. On Network tab click "All" to see all static files being requested from the Server and examine those that show in "Red" or says "Fail". Then click on one of the failed files and examine the "Header" section of the section opened. This is an important step, verify that the port that shows next to localhost:(port number) matches with the port number you started Rails Server on. If not, that is where the problem is. To Fix this, Stop the Rails Server by pressing Ctrl + C (If pressing Ctrl + C) does not stop the Rails Server then kill Puma Process with this command (pkill -9 -f puma) make sure you are in a website directory for these commands to work.
    - After the Rails Server has been stopped, Start the Rails Server on a port you saw in the Development Tools e.g localhost:3012 by typing this command: rails s -p 3012  
    - Your problem should be solved. If not, then proceed to the rest of the list.
  3. Open up Bash or your favorite Console App and navigate to the folder where the website is located and run:
    - sudo bundle update
    -After the installation or updates are installed try to run the Rails Server by typing: Rails s which starts the server on port 3000
    - Sometimes starting the server on default port does not work, in this case, proceed to number 3.
  4. If number 2 did not work, try starting the Rails Server on a different port like so: rails s -p 3001
  5. If number 3 does not work, observe the logs and pinpoint what the error seems to be and start troubleshooting from there.