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.
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 runninglucky dev
. You can modify theProcfile.dev
to start other processes like running background jobs.
Lucky uses Postgres for its database. Install Postgres (macOS/Others)
apt-get install libc6-dev libevent-dev libpcre2-dev libpng-dev libssl1.0-dev libyaml-dev zlib1g-dev
dnf install glibc-devel libevent-devel pcre2-devel openssl-devel libyaml-devel zlib-devel libpng-devel
. libpng-devel is for Laravel MixYou will need additional dependencies if you want to test your frontend using LuckyFlow, see the Testing HTML and Interactivity guide for details.
Once the required dependencies are installed, set up Lucky for your system.
brew install openssl
to make sure you have OpenSSLbrew tap luckyframework/homebrew-lucky
brew install lucky
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.
git clone
the CLI repo at https://github.com/luckyframework/lucky_cligit checkout v0.18.0
shards install
crystal build src/lucky.cr
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.