- Ruby 2.7.4
- NodeJS (v16), and npm
- Postgresql
Verify which version of Ruby you're running by entering this in the terminal:
$ ruby -vIf none, run:
$ rvm install 2.7.4 --defaultYou should also install the latest versions of bundler and rails:
$ gem install bundler
$ gem install rails
To install Postgres for WSL, run the following commands from your Ubuntu terminal:
```console
$ sudo apt update
$ sudo apt install postgresql postgresql-contribThen confirm that Postgres was installed successfully:
$ psql --versionRun this command to start the Postgres service:
$ sudo service postgresql startFinally, you'll also need to create a database user so that you are able to connect to the database from Rails. First, check what your operating system username is:
$ whoamiIf your username is "ian", for example, you'd need to create a Postgres user with that same name. To do so, run this command to open the Postgres CLI:
$ sudo -u postgres -iFrom the Postgres CLI, run this command (replacing "ian" with your username):
$ createuser -sr ianThen enter control + d or type logout to exit.
This guide has more info on setting up Postgres on WSL if you get stuck.
To install Postgres for OSX, you can use Homebrew:
$ brew install postgresqlOnce Postgres has been installed, run this command to start the Postgres service:
$ brew services start postgresqlRun the following commands from /example-project
$ bundle install$ rails db:migrate$ rails s$ npm i --prefix client$ npm start --prefix clientOnce you have started the server, visit localhost:3000/the_invoices