[LINUX] When I tried to build a Rails environment on WSL2 (Ubuntu 20.04LTS), I stumbled and fell.

What did you try to do?

Since Windows10 20H1 has arrived, I decided to use WSL2 to prepare the Rails environment. I put Ubuntu 20.04LTS, and when I set it up, I stumbled and fell in an unexpected place.

What happened?

--You can install Ruby --I was able to install Rails with gem --MariaDB was also installed --Let's start it normally

$sudo systemctl start mysql
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to create bus connection: Host is down

I got an error.

why?

WSL2 doesn't seem to support systemd (strictly it seems to exist but has been disabled). Even if it is enabled, it cannot be started with PID 1, so systemctl cannot be used effectively.

Countermeasures

I tried to refer to Hack using Systemd with WSL2. I decided to use the genie command, which seems to be the easiest of all. https://github.com/arkane-systems/genie/

Run

There is a relatively long preparation, but in the end you will execute the following command.

sudo apt install systemd-genie

The following preparation memo

-Access Install .NET Core --Install dotnet-runtime-3.1 --Access wsl-translinux --Execute the script in the Quick install column --Execute the above command

that?

As you can see when I run it, the installation fails with a 404 error. I wonder why there is no package for Ubuntu 20.04 LTS yet. What ...

Conclusion

Currently use Debian or Ubuntu 18.04 LTS.

Recommended Posts

When I tried to build a Rails environment on WSL2 (Ubuntu 20.04LTS), I stumbled and fell.
Memo A beginner tried to build a Java environment and Japaneseize it on Ubuntu 18.04.2 LTS.
I tried to build an environment with WSL + Ubuntu + VS Code in a Windows environment
How to build a Python environment using Virtualenv on Ubuntu 18.04 LTS
I tried to build an environment of Ubuntu 20.04 LTS + ROS2 with Raspberry Pi 4
[Go + Gin] I tried to build a Docker environment
A story when a beginner gets stuck trying to build a vim 8.2 + python 3.8.2 + lua plugin environment on Ubuntu 18.04.4 LTS
How to build a new python virtual environment on Ubuntu
I stumbled when I tried to install Basemap, so a memorandum
When I tried to install PIL and matplotlib in a virtualenv environment, I was addicted to it.
I tried to create a server environment that runs on Windows 10
Build Python3 and OpenCV environment on Ubuntu 18.04
I want to build a Python environment
I tried to build a SATA software RAID configuration that boots the OS on Ubuntu Server
I tried to build a Mac Python development environment with pythonz + direnv
Build Linux on a Windows environment. Steps to install Laradock and migrate
Steps to build a Django environment with Win10 WSL Ubuntu18.04 + Anaconda + Apache2
I tried to build an environment that can acquire, store, and analyze tweet data in WSL (bash)
I tried to build a super-resolution method / ESPCN
I tried to build a super-resolution method / SRCNN ①
[Latest] How to build Java environment on Ubuntu
Build a Kubernetes environment for development on Ubuntu
I tried to build a super-resolution method / SRCNN ③
I tried to build a super-resolution method / SRCNN ②
How to build Java environment on Ubuntu (Linux)
When I tried to create a virtual environment with Python, it didn't work
Build a PYNQ environment on Ultra96 V2 and log in to Jupyter Notebook
# 2 Build a Python environment on AWS EC2 instance (ubuntu18.04)
What I did when I stumbled on a Django tutorial
I got a UnicodeDecodeError when pip install on ubuntu
I made a Python3 environment on Ubuntu with direnv.
How to build a Django (python) environment on docker
I want to easily build a model-based development environment
I want to use OpenJDK 11 on Ubuntu Linux 18.04 LTS / 18.10
How to build a Python environment on amazon linux 2
I tried to install scrapy on Anaconda and couldn't
[Rails] How to display multiple markers on Google Map and display a balloon when clicked
How to build a beautiful Python environment on a new Mac and install Jupter Notebook
How to create a Python 3.6.0 environment by putting pyenv on Amazon Linux and Ubuntu
Install LAMP on Amazon Linux 2 and build a WordPress environment.
How to set up WSL2 on Windows 10 and create a study environment for Linux commands
How to share OS and Vim clipboard on Ubuntu 18.04.3 LTS
Ubuntu blew up when I tried to change my username
Build a Python environment and transfer data to the server
When I tried to install Ubuntu 18.04, "Initramfs unpacking failed: Decoding failed" was displayed and the startup failed.
How to build a LAMP environment using Vagrant and VirtulBox Note
I tried to create an environment of MkDocs on Amazon Linux
Build a Chainer environment using CUDA and cuDNN on a p2 instance
Build a 64-bit Python 2.7 environment with TDM-GCC and MinGW-w64 on Windows 7
Build a Python environment on your Mac with Anaconda and PyCharm
# 3 Build a Python (Django) environment on AWS EC2 instance (ubuntu18.04) part2
A note I was addicted to when making a beep on Linux
I just wrote a script to build Android on another machine
I tried to make a periodical process with Selenium and Python
I tried to register a station on the IoT platform "Rimotte"
When creating an environment that uses python django on Ubuntu 12.04 LTS
I tried to create Bulls and Cows with a shell program
Build Python environment on Ubuntu (when pip is not the default)
Shell script to build pyenv environment on ubuntu in one shot
I tried playing Windows games using Steam Play on Ubuntu 20.04 LTS
What I stumbled upon when using CodeIgniter on a Linux server