Small wiki about known issues on WSL and how to fix them.
It is possible to access Windows files from the terminal.
All Windows files are located on/mnt/#{letter_of_the_drive}
On a default Windows configuration, it'll be /mnt/c
Case: I download an image in my Windows download folder and want to use it in WSL.
I can access it on/mnt/c/Users/barangerbenjamin/downloads/image.png
Where barangerbenjamin is my username on Windows
You followed the solution above and the file does not appear in Sublime text? First step is to restart Sublime Text. The file should appear.
Now the file appears in Sublime text, but Sublime text can't seems to be able to open it. If the file has been created on Windows, the rights on this file will be Windows rights. You need to set the Linux rights on that file aswell. You can do it like this:
sudo chmod +xrw <file_name.extension>
Case: My picture appears but Sublime text can't read it:
sudo chmod +xrw my_picture.png
It is possible to access WSL files from Windows. All WSL files are located on
C:\Users\your-windows-username\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_...\LocalState\rootfs\home\your-ubuntu-username\code\your-github-username
Case: I want to open a Windows File explorer to my WSL files, the path will be:
C:\Users\benjamin\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_...\LocalState\rootfs\home\bbaranger\code\barangerbenjamin
Where benjamin
is my Windows username.
Where bbaranger
is my WSL username.
Where barangerbenjamin
is my github username.
You can do it like so when you have drag and drop your file:
From the WSL terminal
chmod +xrw path_of_the_file/file_name.extension
You get the following error when you try hub browse
:
Please set $BROWSER to a web launcher to use this command
The error is telling you than you need to set the variable BROWSER
to an browser launcher.
You're using Google Chrome:
echo "export BROWSER=/mnt/c/Program\ Files\ \(x86\)/Google/Chrome/Application/chrome.exe" >> ~/.zshrc
You're using Mozilla Firefox:
echo "export BROWSER=/mnt/c/Program\ Files\ \(x86\)/Mozilla\ Firefox/firefox.exe" >> ~/.zshrc
hub browse
should now work with the browser of your choice!
You get the following error:
PG::ConnectionBad could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?
Means you can't rails s
or rails db:create
or rails db:drop
or rails db:migrate
The error indicates that the postgresql
server is either not running (99% cases) or not accepting any connection.
Run the following command in WSL terminal: sudo service postgresql start
to start the server.
Go at the root of the rails project:
cd
cd code/github_username/rails-project
e.g: cd code/barangerbenjamin/rails-mister-cocktail
Remove the current stylesheets folder:
rm -rf app/assets/stylesheets
Download Le Wagon custom stylesheets:
curl -L https://github.com/lewagon/rails-stylesheets/archive/master.zip > stylesheets.zip
Unzip the archive to the app/assets folder:
unzip stylesheets.zip -d app/assets && rm -f stylesheets.zip && rm -f app/assets/rails-stylesheets-master/README.md
Create a new directory stylesheets:
mkdir app/assets/stylesheets
Move the download custom stylesheets in the our new folder:
mv rails-stylesheets-master/* app/assets/stylesheets
Check if everything is correct:
ls app/assets/stylesheets
It should contain 4 folders components
, config
, layouts
and pages
And 1 file application.scss
If everything is correct, you can run:
rm -rf app/assets/rails-stylesheets-master
Error look like this when trying to do sudo apt-get install yarn
?
E: Repository ‘http://dl.google.com/linux/chrome-remote-desktop/deb stable Release’ changed its ‘Origin’ value from ‘Google, Inc.’ to ‘Google LLC’ N: This must be accepted explicitly before updates for this repository can be applied. See apt-secure(8) manpage for details.
Easy fix:
sudo apt update
Install yarn:
sudo apt-get-install yarn