Run the following command to generate a new rails app without any ruby installation in the host machine. it just needs Docker.

```shell
export APP_NAME=myapp ; docker run --rm -v ${PWD}:/$APP_NAME -w /$APP_NAME -t ruby:slim \
sh -c "apt update && apt install -y --no-install-recommends git build-essential libpq-dev\
&& gem install -N rails -v '~>7' \
&& rails new $APP_NAME --database=postgresql --skip-system-test --skip-test \
&& chown -R $(id -u):$(id -g) $APP_NAME/"
```

Because I'm running this command in Manjaro Linux, I need to chown the generated files to my linux user host otherwise the owner would be root and wouldn't be able to do any changes. This `chown` command is not needed in MacOS.

The workdir path can define the rails application name. Hence with the above command, if we were generated the rails app with the command `rails new . --database= ...` you'll  get app name from the parent folder and you can confirm that checking the `config/application.rb` file:

![image](https://user-images.githubusercontent.com/108512/253776364-6d4347c0-f0a9-4227-8668-d386aac654d2.png)

We're skiping the rails default testing becuase usually we setup RSpec as the testing framework