Active::Rails: Starting Your Rails Journey (Windows)
Hey guys! Ruby on Rails is one of my favorite Frameworks for web development cause of its simplicity, efficiency, and ease of use. Building with Rails is awesome! But setting it up on Windows computer can be a bit of a drag. So, to kick off what may be a series on developing with Rails, I will like to quickly go over how to set up your environment on a Windows OS.
To facilitate the process, I have gathered all file links below.

Installation Files
- Git: For version control, and collaboration
- Node and Yarn: For dependencies (other required installations needed later on)
- RubyInstaller: Ruby language installer (Download with Devkit)
- XAMPP: Mysql Database and Apache server
Ruby Installation
Open the RubyInstaller file for installation. On Completion, a command line as shown below will pop up.

When prompted to select what components to install for Ruby, Enter 3.
When this is complete, run “ruby -v” to see what version of Ruby has been installed.

To update all Ruby Gems, run “gem update” inside your project folder.
To install rails gem, run “gem install rails”
To install bundler gem, run “gem install bundler”
To install mysql2 gem, run “gem install mysql2 — -plaform=ruby”
To confirm installation, run “rails -v” for rails version.
Congratulations, you have successfully installed Ruby, and Ruby on Rails.
Other Installations
Open, and follow the instructions to install the other required files.
Starting a Rails Project
We have successfully installed Rails, and Xampp (Mysql), it is time to create our amazing app using Rails.
To create a new rails app “rails new <app_name>”
Replace app_name with the name of your app. In this tutorial, our awesome app will be demoApp.

Yay! If this runs correctly, then our set up was successful. Using your favorite text editor (atom or code), open your project.
Replace “gem sqlite3” with “gem ‘mysql2’, ‘~>0.5.2’” in your Gemfile as shown below

Update your database.yml under config/database.yml as shown below

To create matching user details for your mysql database, open xampp control and click on Admin besides Mysql. See below.

This will redirect you to your phpmyadmin dashboard. Click on user accounts to create a new user matching the information on your database.yml. See below.

Finally, to create our databases, in your command line, navigate to your project directory, and run these commands to install our version of mysql2 and set up the database for our project.
“bundle install”
“rails db:setup”

To start our rails project, run
“rails s” or “rails server”
Hurray!!! Our app runs, and we see this:
codename: Llamas in Pjamas

To view our project listening on port 3000 we visit
localhost:3000
on our favorite browser.

Congratulations
We have successfully installed all the requirements for our environment, and have built our first Rails application. Not like it does anything spectacular :) but it is awesome!
Conclusion
Rails is great for web development, however, its installation and setup can be painstaking…especially if you are in a windows environment. I hope this tutorial helps you with no hiccups along the way, but if you encounter any issues just google it :). Any errors involving psych, uninstall it and reinstall the default version by running
“gem uninstall psych” and “gem install psych -v 2.0.1”.
This is my first tutorial, so I hope it makes it easier for everyone trying to install Rails for the first time.