Last active 1 month ago

otwa-windows.md Raw

Ruby Installation

Step 1: Download RubyInstaller

  1. Go to rubyinstaller.org
  2. Download Ruby+Devkit 3.4.6-1 (x64) (or latest stable 3.4.x version)
  3. Run the installer

Step 2: Install Ruby

  1. During installation, check these options:
    • Add Ruby executables to your PATH
    • Associate .rb and .rbw files with this Ruby installation
  2. Install to the default location: C:\Ruby34-x64
  3. After installation completes, leave the "Run 'ridk install'" checkbox checked
  4. Click Finish

Step 3: Install MSYS2 and Development Tools

  1. A command window will open for MSYS2 installation
  2. Enter 1 and press Enter to install MSYS2 base
  3. Enter 2 and press Enter to install MSYS2 toolchain
  4. Enter 3 and press Enter to install MSYS2 and MINGW development toolchain
  5. When complete, press Enter to close the window

Step 4: Verify Ruby Installation

Open a new PowerShell window:

ruby --version
gem --version

You should see Ruby 3.4.x and gem version numbers.

Step 5: Install Bundler

gem install bundler -v 2.6.9

Database Installation (MariaDB)

Step 1: Download MariaDB

  1. Go to mariadb.org
  2. Select:
    • Product: MariaDB Server
    • Version: 10.5.4 (or latest 10.5.x)
    • OS: Windows
    • Architecture: x64
  3. Download the MSI installer

Step 2: Install MariaDB

  1. Run the MSI installer
  2. Click Next through the welcome screen
  3. Accept the license agreement and click Next
  4. Choose Custom installation
  5. Set installation path to: C:\MariaDB
  6. Click NextInstall
  7. During installation, you'll be prompted for configuration:
    • Root password: Enter a strong password (write it down!)
    • Data directory: Accept default C:\Program Files\MariaDB 10.5\data
    • Port: Accept default 3306
    • Service name: Accept default MariaDB
    • Run as service: Check this box
  8. Complete the installation

Step 3: Verify MariaDB Installation

Open Command Prompt as Administrator:

mysql --version

You should see MariaDB version information.

Step 4: Test Database Connection

mysql -u root -p

Enter your root password. You should see the MariaDB prompt:

Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 8
Server version: 10.5.4-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>

Type exit; to leave the MariaDB prompt.

Step 5: Create Database User

mysql -u root -p

At the MariaDB prompt, run:

CREATE USER 'otwarchive'@'localhost' IDENTIFIED BY 'your_secure_password';
GRANT ALL PRIVILEGES ON *.* TO 'otwarchive'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Redis Installation

Redis does not have an official Windows port, but we have two options:

Option A: Use Memurai (Recommended for Windows)

Memurai is a Redis-compatible server for Windows.

  1. Download Memurai from memurai.com
  2. Run the installer
  3. Accept default installation location: C:\Program Files\Memurai
  4. Complete the installation
  5. Memurai will automatically start as a Windows service

Verify Memurai installation:

redis-cli ping

You should see: PONG

Elasticsearch Installation

Step 1: Download Elasticsearch

  1. Go to elastic.co
  2. Download Elasticsearch 7.17.9 (Windows ZIP archive)
    • Important: Use version 7.17.x, not 8.x (gem compatibility)
  3. Extract the ZIP to: C:\Elasticsearch

Step 2: Configure Elasticsearch

  1. Navigate to: C:\Elasticsearch\config
  2. Open elasticsearch.yml in a text editor
  3. Add or modify these settings:
cluster.name: skaia-library
node.name: node-1
network.host: 127.0.0.1
http.port: 9200
discovery.type: single-node
# Disable security features for simplicity
xpack.security.enabled: false
  1. Save the file

Step 3: Configure JVM Memory

  1. Navigate to: C:\Elasticsearch\config
  2. Open jvm.options in a text editor
  3. Find and modify these lines (adjust based on your RAM):
-Xms1g
-Xmx1g

For 16GB RAM, you can use 2GB:

-Xms2g
-Xmx2g
  1. Save the file

Step 4: Set JAVA_HOME

Elasticsearch requires Java 11 or later.

  1. Download and install Amazon Corretto 11 or Adoptium Temurin 11
  2. Run the installer with default settings
  3. Set JAVA_HOME environment variable:
    • Press Win + R, type sysdm.cpl, press Enter
    • Click AdvancedEnvironment Variables
    • Under System variables, click New
    • Variable name: JAVA_HOME
    • Variable value: C:\Program Files\Eclipse Adoptium\jdk-11.x.x-hotspot (adjust to your installation path)
    • Click OK
    • Find Path variable, click Edit
    • Add: %JAVA_HOME%\bin
    • Click OK on all dialogs

Step 5: Start Elasticsearch

Open Command Prompt as Administrator:

cd C:\Elasticsearch\bin
elasticsearch.bat

Elasticsearch will start and you'll see log output. Leave this window open for now.

Verify Elasticsearch is running: Open a new PowerShell window:

curl http://localhost:9200

You should see JSON output with cluster information.

Step 6: Install Elasticsearch as Windows Service (Optional)

To run Elasticsearch as a Windows service, you'll need to use a service wrapper like NSSM (Non-Sucking Service Manager):

  1. Download NSSM from nssm.cc
  2. Extract to: C:\nssm
  3. Open Command Prompt as Administrator:
    cd C:\nssm
    nssm install Elasticsearch C:\Elasticsearch\bin\elasticsearch.bat
    nssm start Elasticsearch
    

Memcached Installation

Step 1: Download Memcached

  1. Download memcached from releases.replicated.com or use a Windows port
  2. Extract to: C:\memcached

Option A: Use the Windows Port

  1. Download from allegro.com or search for "memcached windows"
  2. Extract to: C:\memcached
  3. Open Command Prompt as Administrator:
    cd C:\memcached
    memcached.exe -d install
    memcached.exe -d start
    

Option B: Use Docker (Hybrid Approach)

If you want to use Docker just for Memcached:

docker run -d -p 11211:11211 memcached:1.5

For this guide, we'll assume Option A (native Windows).

Verify Memcached is running:

telnet localhost 11211

If connected, type stats and press Enter. You should see statistics. Press Ctrl+] then quit to exit.

Node.js Installation

Rails uses Node.js for JavaScript asset compilation.

Step 1: Download Node.js

  1. Go to nodejs.org
  2. Download the LTS version (Long Term Support)
  3. Run the installer

Step 2: Install Node.js

  1. Accept all default options
  2. Complete the installation

Verify Node.js installation:

node --version
npm --version