Installing Crystal+Lucky on M1 Mac

Reading time: about 1 minute

Mac+M1+Crystal+Lucky

This is the series of steps I followed to get Crystal and Lucky running on a Mac M1 from scratch, as of Oct. 2021.

Prerequisites

Installing crystal

From this issue comment the “second gen” build comes as a tar.gz. This is a direct link to the archive.

#!/bin/bash

export CRYSTAL_PATH='lib:/opt/crystal-ci-univ2nd-dev-1/src'

export CRYSTAL_LIBRARY_PATH="$(brew --prefix)/lib"
export LDFLAGS="/opt/homebrew/opt/openssl@1.1/lib"
export CPPFLAGS="/opt/homebrew/opt/openssl@1.1/include"
export PKG_CONFIG_PATH="/opt/homebrew/opt/openssl@1.1/lib/pkgconfig"
export PATH="/opt/homebrew/opt/openssl@1.1/bin:$PATH"

exec '/opt/crystal-ci-univ2nd-dev-1/bin/crystal' "${@}"
Crystal 1.2.0-dev [d7f25e0c6] (2021-09-15)

LLVM: 10.0.0
Default target: aarch64-apple-darwin

Setting up shards

Setting up lucky cli


Date: 2021-Oct-05
Tags: crystal lucky mac m1
Previous: Automatic build time metadata generator for ELB ping endpoints and other sanity.
Next: Managing services on macos with launchctl