# If you would like to set a password for the user, you can do the following Feel free to replace chris with your username. The postgres installation doesn't setup a user for you, so you'll need to follow these steps to create a user with permission to create databases. You'll need to start postgresql each time you load your WSL environment. Setting Up PostgreSQLįor PostgreSQL, we're going to add a new repository to easily install a recent version of Postgres. If you get a different result for some reason, it means your environment may not be setup properly. Now that you've installed Rails, you can run the rails -v command to make sure you have everything installed correctly: rails -v Installing RailsĬhoose the version of Rails you want to install: Once you've done this, you can check and see if it worked: ssh -T should get a message like this: Hi excid3! You've successfully authenticated, but GitHub does not provide shell access. You want to copy and paste the output of the following command and paste it here. Git config -global user.email -t ed25519 -C next step is to take the newly generated SSH key and add it to your Github account. Replace my name and email address in the following steps with the ones you used for your Github account. If you don't already have a Github account, make sure to register. We'll be using Git for our version control system so we're going to set it up to match our Github account. # Install yarn for Rails jsbundling/cssbundling or webpacker Then we can install the latest Node.js for handling Javascript in our Rails apps: asdf install nodejs 18.16.1 To install Ruby and set the default version, we'll run the following commands: asdf install ruby 3.2.2Ĭonfirm the default Ruby version matches the version you just installed. asdf plugin add rubyĬhoose the version of Ruby you want to install: For Rails, we can install Ruby and Node.js for our frontend Javascript. Then we can install ASDF plugins for each language we want to use. "$HOME/.asdf/completions/asdf.bash"' > ~/.bashrcĮcho 'legacy_version_file = yes' > ~/.asdfrcĮcho 'export EDITOR="code -wait"' > ~/.bashrc First you install asdf, and then add it to your shell:Įcho '. Installing asdf is a simple two step process. The reason we use ASDF over rbenv, rvm or others is that ASDF can manage other languages like Node.js too. Next we're going to be installing Ruby using a version manager called ASDF. Sudo apt-get install git-core zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev software-properties-common libffi-dev Open your Terminal and run the following commands to install them. The first step is to install dependencies for compiling Ruby. You'll use this to run your Rails server and other processes for development. You can search for "Ubuntu" in the Windows Start Menu anytime to open the Ubuntu terminal.Ĭongrats! You now have Ubuntu installed on Windows with WSL. Once initial setup is finished, you will be prompted to create a username and password for your Ubuntu install. Reboot your computer to finish the installation. Open Powershell and run: wsl -install -d Ubuntu You must be running Windows 10 version 2004 and higher (Build 19041 and higher) or Windows 11. We'll use this to install Ruby and run our Rails apps. Windows allows you to run various Linux operating systems inside of Windows similar to a virtual machine, but natively implemented. Installing the Windows Subsystem for Linux Ruby on Rails will always be deployed to a Linux server, so it's best for us to use the same for development. This allows you to install a Linux distribution natively on Windows without a virtual machine. We're going to use the Windows Subsystem for Linux (WSL) to accomplish this. In this guide, we will be installing Ruby on Rails on Windows 10.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |