Last active
December 11, 2018 16:26
-
-
Save Gordonei/06a624f7da93382efb70e25d780a1052 to your computer and use it in GitHub Desktop.
Script for finding invalid YAML config files that might be borking your rails console from starting up
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
SEARCH_ROOT=/opt/gitlab/ | |
find "$SEARCH_ROOT" -name *.yml | while read line; do echo $line | ruby -e "require 'yaml';filename=STDIN.read.strip; YAML.load_file filename; puts filename"; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When loading up the gitlab rails console, I was getting a YAML parsing error (
mapping values are not allowed in this context at line x column y (Psych::SyntaxError)
).Wrote this script to help me track it down - it finds all YAML files, and tries to load them one by one.