I tried upgrading to 1.0.0, unfortunately, I have 3rd-party shard dependencies which haven’t been updated to support 1.0.0 yet. So, I need to downgrade back to 0.36.1.
I see that @bcardiffupdated the brew formula for 1.0.0. Is there a way to brew install crystal@0.36.1?
I really don’t want to have to try to build it manually on my machine…
If the problem is that packages are not updated I would go with @Blacksmoke16 suggestions. It is likely that the package will run on 1.0 directly.
If you need or want to stick with 0.36.1 a bit longer you need to do some workaround for that on brew or download the .pkg or .tar.gz for your platform. I usually decompress the .tar.gz and use the ./bin/crystal on that folder directly.
[~/git/pg_csvlog]$ shards update
Resolving dependencies
Fetching https://github.com/will/crystal-pg.git
Fetching https://github.com/taylorfinnell/awscr-signer.git
Fetching https://github.com/crystal-lang/crystal-db.git
Unable to satisfy the following requirements:
- `crystal (>= 0.35.0, < 2.0.0)` required by `pg 0.23.1`
- `crystal (< 1.0.0)` required by `awscr-signer 0.2.1`
Failed to resolve dependencies, try updating incompatible shards or use --ignore-crystal-version as a workaround if no update is available.
Thanks @Blacksmoke16 but why does the message mention pg amongst the requirements it is unable to satisfy? It looks like those requirements should be ok with crystal 1.0.
The error message is generated like that because crytal is yet another dependency. As any other package at that point. The solver found those two constraints incompatible between each other. That’s why it is showing them both IIRC.
Of course there is always room to improve wording.
I remember having to enable a feature flag on Heroku apps to make env vars available inside the buildpack (for a while it seemed unfortunately common for Rails apps to need to talk to the DB during asset precompilation?). Is that still a thing?