Lucky Framework Upgrade

Upgrading from Lucky 0.27.2 to 0.28.0


I learned about Lucky improvements (fixes from the minor bugs after my first article) and wanted to test them out.

The Lucky repo describes the changes to the shards file and the code base too.


First lets be sure we have a recent crystal version:

asdf install crystal 1.1.1
asdf global crystal 1.1.1

Second, Upgrade the lucky-cli:

# if you don't already have this
git clone
cd lucky_cli
git fetch
git checkout v0.28.0  # note this does not match the lucky-framework version (0.27.2)!
shards install
crystal build src/
cp lucky /usr/local/bin
cd ..
lucky -v  # hopefully responds with: 0.28.0

Now lets be sure we update .tools-available in the lucky project folder:

Then (in the project folder - type:

cd project_name  # my lucky-project
asdf local crystal 1.1.1

Lets lets update the shards file to – according to the upgrade guide we should use the following settings:

# shard.yml
name: animals
version: 0.1.0

    main: src/

crystal: >= 1.0.0

    github: luckyframework/lucky
    version: ~> 0.28.0
    github: luckyframework/authentic
    version: ~> 0.8.0
    github: luckyframework/carbon
    version: ~> 0.2.0
  # this should be removed
  # dotenv:
  #   github: gdotdesign/cr-dotenv
  #   version: ~> 0.8.0
  # use this instead - be shure to follow the instructions at (global search and replace is your friend):
    github: luckyframework/lucky_env
    version: ~> 0.1.3
    github: luckyframework/lucky_task
    # version: ~> 0.8.0
    github: crystal-community/jwt
    # version: ~> 0.7.3
    github: luckyframework/lucky_flow
    # version: ~> 0.7.3

Now type:

shards update
shards list

Cool - it worked!

Now lets see if your site still works

crystal spec

and start up the project with:

lucky dev

while we are at it we should update the yarn / node packages too.

yarn upgrade
Bill Tihen
Bill Tihen
Developer, Data Enthusiast, Educator and Nature’s Friend

very curious – known to explore knownledge and nature