Bridgetown on Windows
Help Needed! This Documentation page is in need of review and possible revision. Can you help us out?
We’d greatly appreciate it! 😃👍
The easiest way to use Bridgetown on Windows is to install the Windows Subsystem for Linux. This provides a Linux development environment in which you can install Bash, Ruby, and other tools necessary to run Bridgetown in an optimized fashion.
Try reading these excellent instructions by GoRails to install Ubuntu Linux on Windows, and then once you’ve reached the “Installing Rails” portion, you can come back and continue:
Install Node #
Node is a JavaScript runtime that can execute on a server or development machine. NPM is a package manager for JavaScript packages. You’ll need Node in order to install and use esbuild, the frontend asset compiler that runs alongside Bridgetown.
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get update
sudo apt-get install -y nodejs
Install Bridgetown #
Now all that is left is to install Bridgetown!
gem install bridgetown -N -v 2.0.0.beta3
Create a new Bridgetown site at ./mysite
, as well as run bundle install
and
npm install
automatically:
bridgetown new mysite
cd mysite
Now you should be able to build the site and run a live-reload server:
bin/bridgetown start
Try opening the site up in http://localhost:4000. See something? Awesome, you’re ready to roll! If not, try revisiting your installation and setup steps, and if all else fails, reach out to the Bridgetown community for support.
Windows Subsystem for Linux and Live-Reloading
Projects residing on recent versions of WSL (Windows Subsystem for Linux) might face issues with live-reloading if the live-reload server is initialized from a non-Linux directory. For example: initializing the server from a directory within /mnt/c/
.
This issue impacts WSL Version 2 and it’s not Bridgetown-exclusive. You can learn more about it here.
To minimize headaches, we recommend developing from within the Linux file system. If you use VS Code, the Remote WSL extension allows you to interact with the the Linux subsystem directly. It may facilitate your development workflow.