Coder Social home page Coder Social logo

wsl-issues's Introduction

WSL ISSUES

Small wiki about known issues on WSL and how to fix them.

Access Windows files frogm the WSL terminal

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

My Windows file doesn't appear in Sublime

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.

The file appears but can't be oppened

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

Access WSL files from Windows

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.

⚠️ Also, using drag and drop from windows will not set the right on the file for WSL, meaning you'll have to do it manually
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

Hub browse doesn't work

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

⚠️IMPORTANT::warning: Restart your terminal.
hub browse should now work with the browser of your choice!

Rails - PG::ConnectionBad

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.

Replace Rails' stylesheets by Le Wagon's stylesheets

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

Yarn doesn't install

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

wsl-issues's People

Contributors

barangerbenjamin avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.