RVM: "sha256sum nor shasum found"

ciastek's answer worked for me until I tried to run rvm within a $() in a bash script - rvm couldn't see the sha256sum function. So I created a file called sha256sum with the following contents:

openssl sha256 "$@" | awk '{print $2}'

put it in ~/bin, made it executable, and added that folder to my path (and removed the function from my .bashrc).

(Many thanks to my coworker Rob for helping me find that fix.)


My OpenSSL happened to not have a sha256 enc function for some reason:

$ openssl sha256
openssl:Error: 'sha256' is an invalid command.

After some googling, I found that there is an equivalent called gsha256sum that comes with the homebrew recipe "coreutils". After installing that (brew install coreutils), I had a gsha256sum binary in /usr/local/bin, so it was just a matter of symlinking it:

$ sudo ln -s /usr/local/bin/gsha256sum /usr/local/bin/sha256sum

That fixed it for me.


On MacOS Sierra run

$ shasum -a 256 filename

Based on @vikas027 comment just add

alias sha256sum='shasum -a 256' to your ~/.zshrc


Means you're missing the binary in /usr/bin or your path is somehow missing /usr/bin. Open a new shell and run echo $PATH | grep '/usr/bin' and see if its returned. Also, ls -alh /usr/bin/shasum and make sure the binary is there and executable. There is no sha256sum on OS X, just shasum.

Tags:

Rvm