Skip to content

Commit 859ab93

Browse files
Refactor titles and section headings for consistency in Ruby on Rails documentation
1 parent b32fca7 commit 859ab93

File tree

4 files changed

+56
-37
lines changed

4 files changed

+56
-37
lines changed

content/learning-paths/servers-and-cloud-computing/ruby-on-rails/background.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Getting started with Ruby on Rails on Google Axion C4A
2+
title: Get started with Ruby on Rails on Google Axion C4A
33

44
weight: 2
55

content/learning-paths/servers-and-cloud-computing/ruby-on-rails/baseline.md

Lines changed: 44 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ weight: 5
66
layout: learningpathall
77
---
88

9-
## Set up Ruby on Rails with PostgreSQL on SUSE Arm64
9+
## Overview
1010

1111
Follow these steps to install PostgreSQL, connect it to a Ruby on Rails app, and verify everything works on a SUSE Arm64 Google Cloud C4A VM.
1212

@@ -127,9 +127,9 @@ development:
127127
## Change the Authentication Method
128128
By default, PostgreSQL on many Linux distributions (including SUSE) uses the ident authentication method for local connections. This method maps Linux system usernames directly to PostgreSQL roles. While convenient for local access, it prevents password-based authentication, which is necessary for Rails and most application connections.
129129

130-
To allow Rails to connect using a username and password, change the authentication method in PostgreSQL’s configuration file `pg_hba.conf` from ident to md5.
130+
To allow Rails to connect using a username and password, change the authentication method in PostgreSQL’s configuration file `pg_hba.conf` from ident to md5:
131+
131132

132-
Open your configuration file
133133
```console
134134
sudo vi /var/lib/pgsql/data/pg_hba.conf
135135
```
@@ -220,10 +220,25 @@ In the PostgreSQL shell, run:
220220
\d tasks
221221
\q
222222
```
223+
Connect to PostgreSQL as the database superuser and inspect the table structure:
224+
225+
```console
226+
sudo -u postgres psql
227+
```
228+
229+
In the PostgreSQL shell, connect to your Rails development database and examine the tasks table:
230+
231+
```console
232+
\c db_test_rubyapp_development
233+
\d tasks
234+
\q
235+
```
236+
237+
This sequence of commands does the following:
223238
- `sudo -u postgres psql` → Launches the PostgreSQL shell as the superuser `postgres`.
224-
- `\c db_test_rubyapp_development` → Connects to the Rails apps development database.
239+
- `\c db_test_rubyapp_development` → Connects to the Rails app's development database.
225240
- `\d tasks` → Displays the schema (columns and types) of the `tasks` table.
226-
- `\q → Exit from the PostgreSQL shell
241+
- `\q` → Exit from the PostgreSQL shell.
227242

228243
You should see output similar to:
229244
```output
@@ -245,43 +260,47 @@ Indexes:
245260
"tasks_pkey" PRIMARY KEY, btree (id)
246261
```
247262

248-
## Open port 3000 in Google Cloud (VPC firewall)
249-
Before proceeding to run the Rails server, you need to allow port 3000 from your GCP console. Below are the steps to do that:
263+
## Configure Google Cloud firewall to allow port 3000
264+
265+
Your Rails app runs on port 3000 by default. To access it from your browser, you need to configure Google Cloud's firewall to allow incoming connections on this port.
250266

251-
a. On the GCP console, navigate to **Firewall** -> **Create Firewall Rule**
267+
Navigate to the firewall settings in your Google Cloud Console:
268+
269+
- Open the **Navigation menu** (hamburger icon in the top left)
270+
- Go to **VPC network****Firewall**
271+
- Click **Create Firewall Rule**
252272

253-
![Firewall Info alt-text#center](images/firewall1.png "Figure 1: Firewall Create")
273+
![Google Cloud Console navigation menu showing VPC network section expanded with Firewall option highlighted, displaying the standard Google Cloud interface with blue sidebar navigation and white background alt-text#center](images/firewall1.png "Create firewall rule")
254274

255-
b. Fill in the details as below:
275+
Fill in the details as below:
256276

257-
Give a **name** for your desired port (e.g., `allow-3000-ingress`).
277+
- Provide a **name** for your desired port (for example, `allow-3000-ingress`).
258278

259-
![Allow Ingress alt-text#center](images/firewall2.png "Figure 2: Allow-3000-ingress ")
279+
![Google Cloud Console firewall rule creation form showing Name field with allow-3000-ingress entered, Direction of traffic set to Ingress, Action set to Allow, Targets dropdown showing All instances in the network option, and Source IP ranges field containing 0.0.0.0/0 for unrestricted access, displayed in the standard white Google Cloud interface with blue accent colors alt-text#center](images/firewall2.png "Allow-3000-ingress ")
260280

261281

262-
Set **Direction of Traffic** to **"Ingress"**.
282+
- Set **Direction of Traffic** to **Ingress**.
263283

264-
Set **Target** to **"All Instances in the Network"**. You can also choose **"Specific Tags"**.
284+
- Set **Target** to **All Instances in the network**. You can also select **Specific Tags**.
265285

266-
Set the **Source IPv4 range** to **"0.0.0.0/0"**, for global access.
286+
- Set the **Source IPv4 range** to `0.0.0.0/0`, for global access.
267287

268-
![Set Direction of Traffic alt-text#center](images/firewall3.png "Figure 3: Target Set")
269-
270-
In the **"Protocols and Ports"**, click on **"TCP"**, and mention the port number **"3000"**.
288+
![Google Cloud Console firewall rule creation form showing Direction of traffic field set to Ingress with a dropdown menu, Target field displaying All instances in the network option, and Source IP ranges field visible below, all within the standard Google Cloud interface featuring white background and blue accent elements alt-text#center](images/firewall3.png "Setting the target")
289+
In the **Protocols and ports** section, select **TCP** and enter `3000` in the port field:
271290

272-
![Set Protocols and Ports alt-text#center](images/firewall4.png "Figure 4: Protocols and Ports")
291+
![Google Cloud Console firewall rule configuration page showing Protocols and ports section with TCP checkbox selected and port 3000 entered in the Specified ports field, displaying Allow on match radio button selected, with clean white interface and blue Google Cloud styling alt-text#center](images/firewall4.png "Protocols and ports")
273292

274293

275-
Click on **"Create"**. The Firewall rule will be created successfully and can be viewed in the Firewall Policies Page:
294+
- Select **Create**. Your firewall rule is created and appears in the Firewall policies page:
276295

277-
![ Create Firewall rule alt-text#center](images/firewall5.png "Figure 5: Create Firewall rule")
296+
![Google Cloud Console Firewall Policies page showing a list of firewall rules including the newly created allow-3000-ingress rule with status enabled, displaying rule names, directions, priorities, and actions in a clean white interface with blue Google Cloud branding alt-text#center](images/firewall5.png "Create Firewall rule")
278297

279298
## OS firewall (firewalld) on SUSE
280299
Once done, go back to your VM, install FirewallD:
281300
```console
282301
sudo zypper install firewalld
283302
```
284-
Now start FirewallD and execute the commands to allow port 3000:
303+
Now start FirewallD and run the commands to allow port 3000:
285304

286305
```console
287306
sudo systemctl start firewalld
@@ -296,18 +315,18 @@ Now that port 3000 is allowed in your VM’s ingress firewall rules, you can sta
296315
```console
297316
rails server -b 0.0.0.0
298317
```
299-
- This command lets you access Rails from your browser using the VM’s external IP.
318+
This command lets you access Rails from your browser using the VM’s external IP.
300319

301320

302321
## Access the Rails application:
303-
Open a web browser on your local machine (Chrome, Firefox, Edge, etc.) and enter the following URL in the address bar:
322+
Open a web browser on your local machine and enter the following URL in the address bar:
304323

305324
```
306325
http://[YOUR_VM_EXTERNAL_IP]:3000
307326
```
308327
- Replace `<YOUR_VM_PUBLIC_IP>` with the public IP of your GCP VM.
309328

310-
You will see a Rails welcome page in your browser if everything is set up correctly. It looks like this:
329+
You will see a Rails welcome page in your browser if everything is set up correctly, as shown below:
311330

312331
![Rails default welcome page displaying Ruby on Rails framework logo with green and red styling, welcome message, and navigation links for About your application environment, getting started guide, and Rails documentation on a clean white background alt-text#center](images/rails-web.png "Ruby/Rails welcome page")
313332

content/learning-paths/servers-and-cloud-computing/ruby-on-rails/benchmarking.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Ruby on Rails Benchmarking
2+
title: Benchmark Ruby on Rails
33
weight: 6
44

55
### FIXED, DO NOT MODIFY
@@ -25,7 +25,7 @@ Create a new Ruby file called `benchmark.rb` to measure your Rails application's
2525
vi benchmark.rb
2626
```
2727

28-
This file will contain the benchmarking code that tests different aspects of your application's performance.
28+
This file contains the benchmarking code that tests different aspects of your application's performance.
2929
Copy the following code into `benchmark.rb`. This code measures three different aspects of your Rails application's performance:
3030

3131

@@ -68,7 +68,7 @@ This benchmarking script tests three key areas of your Rails application's perfo
6868

6969
This code gives you a basic understanding of how your Rails app performs under different types of workloads.
7070

71-
### Run the benchmark inside Rails
71+
## Run the benchmark inside Rails
7272
Now that your benchmark file is ready, run it within the Rails environment using the following command:
7373

7474
```console
@@ -91,7 +91,7 @@ DB Insert: 2.271645 0.050236 2.321881 ( 2.721631)
9191
DB Query: 3.379849 0.009345 3.389194 ( 3.389613)
9292
Computation: 0.410907 0.000000 0.410907 ( 0.410919)
9393
```
94-
## Interpet your benchmark results
94+
## Interpret the benchmark results
9595

9696
The output shows four different timing measurements that help you understand where your application spends its time.
9797

@@ -115,7 +115,7 @@ Here are the performance results from running the benchmark on a `c4a-standard-4
115115
| DB Query | 3.38 sec | 0.01 sec | 3.39 sec | 3.39 sec |
116116
| Computation | 0.41 sec | 0.00 sec | 0.41 sec | 0.41 sec |
117117

118-
### What these results tell you
118+
## What these results tell you
119119

120120
- Database operations (insert and query) take significantly longer than pure computation, with queries being the slowest operation.
121121
- System time is minimal across all tasks, indicating efficient system resource usage on Arm64.

content/learning-paths/servers-and-cloud-computing/ruby-on-rails/installation.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ echo 'eval "$(rbenv init -)"' >> ~/.bashrc
3535
source ~/.bashrc
3636
```
3737
These commands configure rbenv for your environment by doing the following:
38-
- Cloning the rbenv repository to your home directory
39-
- Adding rbenv to your PATH so the shell can find it
40-
- Configuring rbenv to initialize automatically in new shell sessions
38+
- Cloning the rbenv repository to your home directory.
39+
- Adding rbenv to your PATH so the shell can find it.
40+
- Configuring rbenv to initialize automatically in new shell sessions.
4141
## Install ruby-build plugin
4242
Install the `ruby-build` plugin to enable rbenv to compile and install Ruby versions from source:
4343

@@ -57,9 +57,9 @@ ruby -v
5757
```
5858

5959
This process accomplishes several tasks:
60-
- Downloads and compiles Ruby 3.4.6 from source, optimized for your Arm64 architecture
61-
- Sets Ruby 3.4.6 as the default version system-wide for your user account
62-
- Verifies the installation by displaying the active Ruby version
60+
- Downloads and compiles Ruby 3.4.6 from source, optimized for your Arm64 architecture.
61+
- Sets Ruby 3.4.6 as the default version system-wide for your user account.
62+
- Verifies the installation by displaying the active Ruby version.
6363

6464
The compilation process can take several minutes as Ruby builds natively for your Arm processor.
6565

0 commit comments

Comments
 (0)