Get Rolling with Buffalo on Windows

Posted in programming with tags administration golang javascript windows -

Summary

This is the short summary of how to start developing Web applications on Windows with Buffalo. The Go on Windows article provides a more detailed version.

Go on Windows

First, let’s install Scoop, to manage your tools.

Open a PowerShell window, and enter this command:

Set-ExecutionPolicy RemoteSigned -scope CurrentUser

Press A when prompted. This ensures that PowerShell can run Scoop.

Next, install Scoop:

iex (new-object net.webclient).downloadstring('https://get.scoop.sh')

Now enter this command:

scoop install gcc openssh git go nodejs-lts

This installs:

  • Go itself
  • The GCC compiler, so that downloaded C libraries will build on your computer
  • Git, for version control
  • Node.js, the run-time for JavaScript

Buffalo will use GCC to compile SQLite, a database that requires no setting up or administration. SQLite is enough for learning Web development, but you should switch to PostgreSQL for production applications. The Go on Windows article explains how to install PostgreSQL.

The Go tool will automatically create a folder called go in your user account when it is needed. This is your Go workspace. To ensure that Go applications that you compile in the workspace run correctly, enter this in a PowerShell window to register the correct folder:

[Environment]::SetEnvironmentVariable("Path", $env:Path + ";$($env:HOMEDRIVE)$($env:HOMEPATH)\go\bin", [EnvironmentVariableTarget]::User)

Installing Buffalo

To install Buffalo with SQLite, run this command:

go get -u -v -tags sqlite github.com/gobuffalo/buffalo/buffalo

Once it is installed, use the buffalo utility to create and manage your Web applications.

Older article
Notes on PowerShell