Lucky Logo

# Install Required Dependencies

Crystal v0.31.1

We recommend using a version manager to make sure the correct version of Crystal is used with Lucky. Try crenv (recommended) or asdf-crystal (great if you already use asdf)

Alternatively you could install Crystal without a version manager.

Process manager

Lucky uses a process manager to watch assets and start the server in development.

Install one of these process managers: Overmind (recommended), Heroku CLI (great if you plan to use Heroku to deploy), forego, or foreman.

By default Lucky creates a Procfile.dev that defines what processes should be started when running lucky dev. You can modify the Procfile.dev to start other processes like running background jobs.

Postgres database

Lucky uses Postgres for its database. Install Postgres (macOS/Others)

Debian and Fedora dependencies

  • Debian (Ubuntu should be similar): run apt-get install libc6-dev libevent-dev libpcre2-dev libpng-dev libssl1.0-dev libyaml-dev zlib1g-dev
  • Fedora (28): run dnf install glibc-devel libevent-devel pcre2-devel openssl-devel libyaml-devel zlib-devel libpng-devel. libpng-devel is for Laravel Mix

For building assets (skip if building APIs)

Dependencies for browser tests

You will need additional dependencies if you want to test your frontend using LuckyFlow, see the Testing HTML and Interactivity guide for details.

# Install Lucky CLI

Once the required dependencies are installed, set up Lucky for your system.

On macOS

  • Install Homebrew
  • Run brew install openssl to make sure you have OpenSSL
  • Run brew tap luckyframework/homebrew-lucky
  • Run brew install lucky
  • Make sure Postgres CLI tools are installed if you’re using Postgres.app
  • If you are on macOS High Sierra you need to add export PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig to your ~/.bash_profile or ~/.zshrc

If you get an error like this: Package libssl/libcrypto was not found in the pkg-config search path then be sure to run the last step listed above so that Crystal knows where OpenSSL is located.

On Linux

  • git clone the CLI repo at https://github.com/luckyframework/lucky_cli
  • cd into the newly cloned directory
  • Check out latest released version git checkout v0.18.0
  • Run shards install
  • Run crystal build src/lucky.cr
  • Move the generated lucky binary to your path. Most of the time you can move it to /usr/local/bin and it should work: mv lucky /usr/local/bin.

If you needed different steps, please help contribute to this section by editing this page on GitHub.