# Installing specific crystal version with anyenv \[Help\]

**URL:** <https://forum.crystal-lang.org/t/installing-specific-crystal-version-with-anyenv-help/3945>\
**Category:** Help & Support\
**Created:** [October 14, 2021, 11:36pm UTC](https://forum.crystal-lang.org/t/installing-specific-crystal-version-with-anyenv-help/3945 "2021-10-14T23:36:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![SaltyCh1pz](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/saltych1pz/32/1419_2.png) [@SaltyCh1pz](https://forum.crystal-lang.org/u/SaltyCh1pz)\
**Post date:** [October 14, 2021, 11:36pm UTC](https://forum.crystal-lang.org/t/installing-specific-crystal-version-with-anyenv-help/3945/1 "2021-10-14T23:36:02Z")

</div>

Hello kind people of crystal I come as a humble dev whos lost countless hours debugging this issue…

Issue: crystal fails to run from a particular .git directory that has my service

I have a crystal service that I need to do something in but I am hit with this error:

constraints: project is locked to version 0.33 ( I know… but please dont yell)

Error: execution of command failed with code: 1: `cc "${@}" -o '/Users/myUserWoo/.cache/crystal/crystal-run-sam.tmp' -rdynamic -lz `command -v pkg-config \> /dev/null && pkg-config --libs --silence-errors libssl || printf %s '-lssl -lcrypto’` `command -v pkg-config \> /dev/null && pkg-config --libs --silence-errors libcrypto || printf %s ‘-lcrypto’` -lpcre /Users/myUserWoo/.anyenv/envs/crenv/versions/0.33.0/embedded/lib/libgc.a -lpthread /Users/myUserWoo/.anyenv/envs/crenv/versions/0.33.0/src/ext/libcrystal.a -levent -liconv -ldl -L/Users/myUserWoo/.anyenv/envs/crenv/versions/0.33.0/embedded/lib -L/usr/lib -L/usr/local/lib`

make: \*\*\* [db.migrate] Error 1

linker error.

* * *

My Crystal installation process:

$: brew install anyenv

then install crenv as such anyenv install crenv

then install specified crystal version

crenv install 0.33.0

- set this version both locally and globally

* * *

❯ crystal --version

Crystal 0.33.0 (2020-02-14)

LLVM: 6.0.1

Default target: x86\_64-apple-macosx

* * *

my crystal env then looks like:

CRYSTAL\_CACHE\_DIR="/Users/myUserWoo/.cache/crystal"

CRYSTAL\_PATH="/Users/myUserWoo/.anyenv/envs/crenv/versions/0.33.0/share/crystal/src:/Users/manuelsaleta/.anyenv/envs/crenv/versions/0.33.0/src:libs:lib"

CRYSTAL\_VERSION=“0.33.0”

CRYSTAL\_LIBRARY\_PATH="/Users/myUserWoo/.anyenv/envs/crenv/versions/0.33.0/embedded/lib"

* * *

MacOS Info:

BigSur 11.6 (Intel based cpu)

* * *

Some exports ive added to my .shellrc file

export PKG\_CONFIG\_PATH="/usr/local/opt/openssl@3/lib/pkgconfig"

export PATH="/usr/local/opt/openssl@3/bin:$PATH"

export LDFLAGS="-L/usr/local/opt/openssl@3/lib"

export CPPFLAGS="-I/usr/local/opt/openssl@3/include"

export PATH="/usr/local/opt/llvm@11/bin:$PATH"

export PKG\_CONFIG\_PATH=$PKG\_CONFIG\_PATH:/usr/local/opt/openssl/lib/pkgconfig

* * *

Im new to MacOS and Crystal coming from a .net background this has been a bit challenging…

ive gone through many of the github threads searching for an answer

Something to note:

I can run and compile crystal files outside of the project’s directory

* * *

Mods if this is not the right place kindly let me know thank you.

Any help is appreciated D: thank you

---

<div class="post-metadata">

**Author:** ![Blacksmoke16](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/blacksmoke16/32/1241_2.png) [@Blacksmoke16](https://forum.crystal-lang.org/u/Blacksmoke16)\
**Post date:** [October 15, 2021, 12:02am UTC](https://forum.crystal-lang.org/t/installing-specific-crystal-version-with-anyenv-help/3945/2 "2021-10-15T00:02:15Z")

</div>

Is there anymore output above the `Error: execution of command failed with code: 1` line?

I noticed you seem to be using openssl3. Might be related to [Support OpenSSL 3.0 · Issue #11231 · crystal-lang/crystal · GitHub](https://github.com/crystal-lang/crystal/issues/11231)?

---

<div class="post-metadata">

**Author:** ![SaltyCh1pz](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/saltych1pz/32/1419_2.png) [@SaltyCh1pz](https://forum.crystal-lang.org/u/SaltyCh1pz)\
**Post date:** [October 15, 2021, 1:55am UTC](https://forum.crystal-lang.org/t/installing-specific-crystal-version-with-anyenv-help/3945/3 "2021-10-15T01:55:28Z")

</div>

Hello Blacksmoke16 - thanks for the link; on the error bit Here is more info:  
The undefined keys

Undefined symbols for architecture x86\_64:  
“\_EVP\_MD\_size”, referenced from:  
\_\*OpenSSL::Digest#digest\_size:Int32 in O-penS-S-L-5858D-igest.o  
“\_EVP\_PKEY\_size”, referenced from:  
\_\*OpenSSL::PKey::RSA@OpenSSL::PKey::PKey#max\_encrypt\_size:Int32 in O-penS-S-L-5858P-K-ey5858R-S-A-.o  
ld: symbol(s) not found for architecture x86\_64  
clang: error: linker command failed with exit code 1 (use -v to see invocation)  
Error: execution of command failed with code: 1: `cc "${@}" -o '/Users/manuelsaleta/.cache/crystal/crystal-run-sam.tmp' -rdynamic -lz `command -v pkg-config \> /dev/null && pkg-config --libs --silence-errors libssl || printf %s '-lssl -lcrypto’` `command -v pkg-config \> /dev/null && pkg-config --libs --silence-errors libcrypto || printf %s ‘-lcrypto’` -lpcre /Users/anywhowoo/.anyenv/envs/crenv/versions/0.33.0/embedded/lib/libgc.a -lpthread /Users/anywhowoo/.anyenv/envs/crenv/versions/0.33.0/src/ext/libcrystal.a -levent -liconv -ldl -L/Users/anywhowoo/.anyenv/envs/crenv/versions/0.33.0/embedded/lib -L/usr/lib -L/usr/local/lib`  
make: \*\*\* [db.migrate] Error 1

---

<div class="post-metadata">

**Author:** ![Blacksmoke16](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/blacksmoke16/32/1241_2.png) [@Blacksmoke16](https://forum.crystal-lang.org/u/Blacksmoke16)\
**Post date:** [October 15, 2021, 2:07am UTC](https://forum.crystal-lang.org/t/installing-specific-crystal-version-with-anyenv-help/3945/4 "2021-10-15T02:07:39Z")

</div>

Okay, yea. I’d maybe just try downgrading to openssl1. That’s prob the only workaround until that issue is resolved.

---

<div class="post-metadata">

**Author:** ![SaltyCh1pz](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/saltych1pz/32/1419_2.png) [@SaltyCh1pz](https://forum.crystal-lang.org/u/SaltyCh1pz)\
**Post date:** [October 15, 2021, 2:08am UTC](https://forum.crystal-lang.org/t/installing-specific-crystal-version-with-anyenv-help/3945/5 "2021-10-15T02:08:44Z")

</div>

@Blacksmoke16 - from your comment I took a second to look at my installed packages.

UPDATE: I was able to get crystal to compile correctly by uninstalling openssl@3 and updating my .shell file to export openssl@1.1 instead as such:

export PKG\_CONFIG\_PATH="/usr/local/opt/openssl@1.1/lib/pkgconfig"

export PATH="/usr/local/opt/llvm@11/bin:$PATH"

export PKG\_CONFIG\_PATH=$PKG\_CONFIG\_PATH:/usr/local/opt/openssl1.1/lib/pkgconfig

export PATH="/usr/local/opt/llvm/bin:$PATH"

Thank you dude!!!
