Skip to main content

Setup Rails

Before setting up rails, you will need to ensure you have versioning tool installed.

  • similar to nvm for node, rbenv for ruby, etc

Versioning Tools

If you understand how to setup your local environments with different versions for different languages/frameworks, you can continue to use them. Some examples:

  • asdf
  • rbenv
  • mise

If this is the first time you are hearing about versioning tools like asdf, rbenv, etc, or have not used any versioning tools before, recommend using mise.

Installing Rails

  1. Follow this tutorial to install:
  • mise
  • ruby 3.3.5
  • rails 8.0.1
  1. Ensure you are able to have a running rails server for an api only rails app
  • Read more here: https://guides.rubyonrails.org/api_app.html

  • Commands

    • rails new rails-onboarding --api -d mysql
    • rails start (localhost:3000)
  • If you want to try stuff out on your own, you can create another rails project with a different name

    • rails new tutorial --api -d mysql

Database

If you do not have mysql installed, install 8.4.

If you already have mysql installed, ensure it is at least version 8.x

note

gorails tutorial shows how to install mysql

VS Code Extensions

Download VS Code and the following extensions:

VS Code Setup

  • launch.json
  • settings.json
  • Make sure the linting and suggestions is working

Ruby (Language Support)

  • rubocop