Did you recently upgrade to Big Sur and now you’re trying to run docker-sync but all you get is /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby: bad interpreter: No such file or directory?

Running gem install docker-sync did not help and more strangely, gem install docker-sync installs version 0.0.11 even though the most recent version is 0.5.14?

# You need to use ruby 2.x since the docker-compose gem dependency
# does not run with ruby 3.x
brew install ruby@2.6

# Manually installing the dependencies
gem install daemons --source http://rubygems.org
gem install docker-compose --source http://rubygems.org
gem install dotenv --source http://rubygems.org
gem install gem_update_checker --source http://rubygems.org
gem install os --source http://rubygems.org
gem install terminal-notifier --source http://rubygems.org
gem install thor --source http://rubygems.org

# brew install wget if not installed
wget https://rubygems.org/downloads/docker-sync-0.5.14.gem

# Install docker-sync
gem install --local docker-sync-0.5.14.gem

Add the following to your ~/.bash_profile

# Path to your ruby 2.6 (usually like this if installed using homebrew)
export PATH="/usr/local/opt/ruby@2.6/bin:$PATH"
if which ruby >/dev/null && which gem >/dev/null; then
    PATH="$(ruby -r rubygems -e 'puts Gem.user_dir')/bin:$PATH"