Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add guideline for setting up rails on windows through wsl2 #134

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jeppester
Copy link
Contributor

No description provided.

Copy link
Member

@runephilosof-abtion runephilosof-abtion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@jeppester jeppester force-pushed the windows-rails branch 6 times, most recently from 536796e to c0e470c Compare June 4, 2024 06:30
Copy link
Contributor

@hcarreras hcarreras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good. It has some chances to get out of date, but even then, I think it should be easy enough to follow.
I'd love to see what @MikkelHansenAbtion thinks on this one


Open a new terminal window:

1. Press the "⋁" button in the top of the terminal window. Then select "Ubuntu".
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this? :D

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

billede

I should perhaps have added a screenshot. But I was not writing the guide on the same machine as I was going through the process on

Open a new terminal window:

1. Press the "⋁" button in the top of the terminal window. Then select "Ubuntu".
2. Press "0" to setup zsh with an empty `.zshrc`-file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likely to change, but I guess that's fine. It'll be easy enough to follow

Then install asdf:

```sh
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.14.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 maybe a prior step to check what the latest tag is?

Suggested change
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.14.0
You can check the latest version on Github and replace the version number.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was myself not entirely happy about this, but it was what I could grab from the asdf docks.

1. Start VS Code
2. Install the package "Remote Development", it will add a "Remote explorer" entry in the side bar
3. In "Remote explorer", under "WSL Targets", open "Ubuntu"
4. You will now be able to open any folder in the linux file system using "File" > "Open Folder".
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool

@MikkelHansenAbtion
Copy link
Contributor

@jeppester
I tried following the guide and got stuck at step 2, (I already had WSL - Ubuntu):

sudo apt -y install zsh

I tried following this stackOverflow solution, with no change in output from the command.

Then I tried uninstalling McAfee apps (firewall etc) after reading Why do I not have internet access from WSL?

Then I exited WSL and entered wsl --update and retried the command from step 2, same result.

ping archive.ubuntu.com does not give me any response.

As Docker Desktop uses WSL to run, I have now turned it off to see if it interfered somehow, then started a new wsl shell and run step 2 again.
Turned off Windows Defender firewall, still no internet connectivity within WSL.

Lets try reinstalling ubuntu:

wsl --unregister Ubuntu
wsl --install -d Ubuntu
wsl
/mnt/c/Users/meh/Desktop$ sudo apt -y install zsh

Still the same stacktrace.

Seems to me the issue on my machine has something to do with WSL settings / firewalls, and not the distro itself.
I am resolving myself to not put more time into this for now.

Stacktrace:

meh@DESKTOP-U36M5F3:/mnt/c/Users/meh/Desktop$ sudo apt -y install zsh
[sudo] password for meh:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  zsh-common
Suggested packages:
  zsh-doc
The following NEW packages will be installed:
  zsh zsh-common
0 upgraded, 2 newly installed, 0 to remove and 87 not upgraded.
Need to get 4794 kB of archives.
After this operation, 18.2 MB of additional disk space will be used.
Ign:1 http://archive.ubuntu.com/ubuntu jammy/main amd64 zsh-common all 5.8.1-1
Ign:2 http://archive.ubuntu.com/ubuntu jammy/main amd64 zsh amd64 5.8.1-1
Ign:1 http://archive.ubuntu.com/ubuntu jammy/main amd64 zsh-common all 5.8.1-1
Ign:2 http://archive.ubuntu.com/ubuntu jammy/main amd64 zsh amd64 5.8.1-1
Ign:1 http://archive.ubuntu.com/ubuntu jammy/main amd64 zsh-common all 5.8.1-1
Ign:2 http://archive.ubuntu.com/ubuntu jammy/main amd64 zsh amd64 5.8.1-1
Err:1 http://archive.ubuntu.com/ubuntu jammy/main amd64 zsh-common all 5.8.1-1
  Temporary failure resolving 'archive.ubuntu.com'
Err:2 http://archive.ubuntu.com/ubuntu jammy/main amd64 zsh amd64 5.8.1-1
  Temporary failure resolving 'archive.ubuntu.com'
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/z/zsh/zsh-common_5.8.1-1_all.deb  Temporary failure resolving 'archive.ubuntu.com'
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/z/zsh/zsh_5.8.1-1_amd64.deb  Temporary failure resolving 'archive.ubuntu.com'
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

meh@DESKTOP-U36M5F3:/mnt/c/Users/meh/Desktop$ sudo apt-get update
Ign:1 https://ppa.launchpadcontent.net/redislabs/redis/ubuntu jammy InRelease
Ign:2 http://archive.ubuntu.com/ubuntu jammy InRelease
Ign:3 https://packages.redis.io/deb jammy InRelease
Ign:4 http://security.ubuntu.com/ubuntu jammy-security InRelease
Ign:5 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Ign:3 https://packages.redis.io/deb jammy InRelease
Ign:1 https://ppa.launchpadcontent.net/redislabs/redis/ubuntu jammy InRelease
Ign:4 http://security.ubuntu.com/ubuntu jammy-security InRelease
Ign:6 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Ign:3 https://packages.redis.io/deb jammy InRelease
Ign:1 https://ppa.launchpadcontent.net/redislabs/redis/ubuntu jammy InRelease
Ign:4 http://security.ubuntu.com/ubuntu jammy-security InRelease
Ign:2 http://archive.ubuntu.com/ubuntu jammy InRelease
Err:3 https://packages.redis.io/deb jammy InRelease
  Temporary failure resolving 'packages.redis.io'
Err:1 https://ppa.launchpadcontent.net/redislabs/redis/ubuntu jammy InRelease
  Temporary failure resolving 'ppa.launchpadcontent.net'
Err:4 http://security.ubuntu.com/ubuntu jammy-security InRelease
  Temporary failure resolving 'security.ubuntu.com'
Ign:5 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Ign:6 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Ign:2 http://archive.ubuntu.com/ubuntu jammy InRelease
Ign:5 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Ign:6 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Err:2 http://archive.ubuntu.com/ubuntu jammy InRelease
  Temporary failure resolving 'archive.ubuntu.com'
Err:5 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
  Temporary failure resolving 'archive.ubuntu.com'
Err:6 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
  Temporary failure resolving 'archive.ubuntu.com'
Reading package lists... Done
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy-updates/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy-backports/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/jammy-security/InRelease  Temporary failure resolving 'security.ubuntu.com'
W: Failed to fetch https://packages.redis.io/deb/dists/jammy/InRelease  Temporary failure resolving 'packages.redis.io'
W: Failed to fetch https://ppa.launchpadcontent.net/redislabs/redis/ubuntu/dists/jammy/InRelease  Temporary failure resolving 'ppa.launchpadcontent.net'
W: Some index files failed to download. They have been ignored, or old ones used instead.

@runephilosof-abtion
Copy link
Member

Should this guide also propose a way to be able to run capybara browser non-headless, or is that already working somehow?

@jeppester
Copy link
Contributor Author

Should this guide also propose a way to be able to run capybara browser non-headless, or is that already working somehow?

I have not tested it, but according to the WSL docs, x-forwarding should work out of the box for WSL 2.
I might have a chance to test it today though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants