Skip to content

Latest commit

 

History

History
255 lines (167 loc) · 4.22 KB

File metadata and controls

255 lines (167 loc) · 4.22 KB

Install Gumroad for development on Windows

Table of Contents


Getting Started

Prerequisites

Enable Long Paths in Git (One-time setup)

Run this in PowerShell as Administrator to avoid long file path issues:

git config --system core.longpaths true

Install WSL and Ubuntu

  1. Open PowerShell as Administrator and run:

    wsl --install
  2. Restart if prompted.

  3. Choose a non-root username and password in the Ubuntu setup.

  4. Always launch Ubuntu for development work (not PowerShell or CMD).


For Windows (using WSL + Ubuntu)

Ruby

Install the version specified in .ruby-version (e.g., 3.4.3) using rbenv:

# Base toolchain + rbenv
sudo apt update
sudo apt install -y \
  rbenv ruby-build git \
  build-essential autoconf bison libssl-dev zlib1g-dev \
  libreadline-dev libyaml-dev libffi-dev libgmp-dev

# One-time shell initialisation (also add to ~/.bashrc or ~/.zshrc)
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"

# Install Ruby
rbenv install 3.4.3
rbenv global 3.4.3

Node.js

Install the version specified in .node-version (e.g., 20.17.0) using nvm:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
source ~/.bashrc
nvm install 20.17.0
nvm use 20.17.0

Docker

  1. Download Docker Desktop: https://www.docker.com/products/docker-desktop
  2. Open Docker → ⚙️ → Resources > WSL Integration
  3. Enable Ubuntu.
  4. Ensure Docker Desktop shows "Engine Running".

MySQL & Percona Toolkit

You don’t need to run MySQL locally — only its client libraries.

sudo apt install libmysqlclient-dev mysql-client

For Percona Toolkit:

sudo apt install percona-toolkit

Image Processing Libraries

Install the required dependencies:

sudo apt update && sudo apt install -y \
  build-essential libxslt-dev libxml2-dev \
  imagemagick libvips-dev ffmpeg pdftk

Installation

Ruby Gems (via Bundler)

gem install bundler
bundle install
gem install dotenv

Node.js Packages

corepack enable
npm install

Configuration

Optional: Create .env file

Copy the example and fill in secrets (if needed):

cp .env.example .env

Running Locally

Start Docker services

LOCAL_DETACHED=true make local

Start the app

In a new terminal:

sudo apt install libxslt-dev libxml2-dev
bin/rails db:prepare
bin/dev

Visit: https://gumroad.dev


Development

Logging In

Use:

  • Email: seller@gumroad.com
  • Password: password
  • 2FA: 000000

See Users & authentication for other roles.

Reset Elasticsearch Indices

Run in Rails console:

DevTools.delete_all_indices_and_reindex_all

Common Tasks

Rails Console

bin/rails c

Rake Tasks

bin/rake <task_name>

Linting

We use ESLint (JS) and RuboCop (Ruby). You can enable pre-commit hooks:

git config --local core.hooksPath .githooks

🛑 Fixing HTTPS or Privacy Warnings in Chrome

  • On Your connection is not private, type: thisisunsafe

  • To clear HSTS:

    • Go to chrome://net-internals/#hsts
    • Under Delete domain security policies, enter gumroad.dev

🧭 /etc/hosts Setup

Add this entry to your /etc/hosts:

127.0.0.1 gumroad.dev

Edit the file:

sudo nano /etc/hosts

✅ Final Tips

  • Use WSL Ubuntu only, never PowerShell or CMD.
  • Use the versions from .ruby-version and .node-version.
  • If port :8080 is occupied, kill the process:
sudo lsof -i :8080
kill -9 <PID>
  • Ensure the following environment variable is set (for seller login):
HELPER_WIDGET_SECRET=<any random string>