Skip to content

Commit 37f47c0

Browse files
committed
fix: Correct local setup instructions in Ruby quickstart
Signed-off-by: Atul Chahar <chaharatul92@gmail.com>
1 parent 4b98da6 commit 37f47c0

1 file changed

Lines changed: 18 additions & 9 deletions

File tree

versioned_docs/version-4.0.0/quickstart/samples-sinatra-postgres.md

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,20 @@ You can also check the test summary from your CLI.
117117

118118
### Setup
119119

120-
1. **Install dependencies:**
120+
1. **Start PostgreSQL Container:**
121+
122+
Since we are running the app locally, we need a database. We can spin up a PostgreSQL container easily:
123+
124+
```bash
125+
docker run -d \
126+
--name postgres-local \
127+
-p 5432:5432 \
128+
-e POSTGRES_PASSWORD=postgres \
129+
-e POSTGRES_DB=keploy_demo \
130+
postgres:15
131+
```
132+
133+
2. **Install dependencies:**
121134

122135
```bash
123136
bundle install
@@ -126,22 +139,18 @@ bundle install
126139
![Bundle Install Sinatra](/img/sinatra-postgres/bundle-install.png)
127140

128141

129-
2. **Set up environment variables:**
142+
3. **Set up environment variables:**
143+
144+
Note: We use `127.0.0.1` instead of `localhost` to ensure IPv4 connection.
130145

131146
```bash
132-
export DATABASE_HOST=localhost
147+
export DATABASE_HOST=127.0.0.1
133148
export DATABASE_PORT=5432
134149
export DATABASE_NAME=keploy_demo
135150
export DATABASE_USER=postgres
136151
export DATABASE_PASSWORD=postgres
137152
```
138153

139-
3. **Create the database:**
140-
141-
```bash
142-
createdb keploy_demo
143-
```
144-
145154
### Record Test Cases
146155

147156
```bash

0 commit comments

Comments
 (0)