DEV Community

Aaron Storrer
Aaron Storrer

Posted on

Case Sensitivity in WSL. Watch out!

I recently encountered an error when deploying some new updates to a Rails Application. (Our Client is in healthcare, I can't say more.) The error? The application could not find a missing .xml template in production, but it could on the development workstations. Even stranger - version control couldn't find any differences.
Now, this is elementary to those using Linux and MacOS to develop their software - file names and their extensions are case sensitive. When using Ubuntu under Windows subsystem for Linux, try the following in the console:
Make a directory and navigate to it.
mkdir test && cd test
Create a file.
touch test.XML
Now here is the fun part. Watch what happens when you run...
mv test.XML test.xml
In WSL, this is what you get:
mv: 'test.XML' and 'test.xml' are the same file
What's going on? Well, on the workstation that we used to create the template, somebody made a typo and typed (XML) instead of (xml) and the workstation was configured not to look for case sensitivity. There are ways to change this behavior, per this article.
If you are using Windows and WSL and you are used to working on a Mac, take note - danger!

Discussion (0)