The ls command of FreebSD does not understand the --search=time parameter for the ls command. "ls -t" is equivalent and behaves on Linux in the same way.
echo "Differences in configuration files..."
cd $PEERTUBE_PATH/versions
-diff -u "$(ls --sort=t | head -2 | tail -1)/config/production.yaml.example" "$(ls --sort=t | head -1)/config/production.yaml.example"
+diff -u "$(ls -t | head -2 | tail -1)/config/production.yaml.example" "$(ls -t | head -1)/config/production.yaml.example"
echo ""
echo "==========================================="