diff --git a/script/setup b/script/setup index d8f03ae63b..8e4c0aa941 100755 --- a/script/setup +++ b/script/setup @@ -19,11 +19,17 @@ NO_COLOR='\033[0m' # Check ruby version RUBY_VERSION=$(cat .ruby-version) -if command -v rbenv > /dev/null; then +if command -v rbenv > /dev/null && ! command rvm > /dev/null; then ./script/rbenv-install.sh -elif ! ruby --version | grep $RUBY_VERSION > /dev/null; then +fi + +if command rvm > /dev/null; then + ./script/rvm-install.sh +fi + +if ! ruby --version | grep $RUBY_VERSION > /dev/null; then printf "${RED}Open Food Network requires ruby ${RUBY_VERSION}${NO_COLOR}. " - printf "Have a look at: https://github.com/rbenv/rbenv\n" + printf "Have a look at your ruby version manager: https://github.com/rbenv/rbenv\n or https://rvm.io/" exit 1 fi