mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Install ruby automatically if rbenv is available
People may use other ways to provide the right Ruby version but if they use rbenv then we can use it automatically.
This commit is contained in:
10
script/setup
10
script/setup
@@ -17,11 +17,13 @@ YELLOW='\033[0;33m'
|
||||
RED='\033[0;31m'
|
||||
NO_COLOR='\033[0m'
|
||||
|
||||
RUBY_VERSION=$(cat .ruby-version)
|
||||
|
||||
# Check ruby version
|
||||
if ! ruby --version | grep $RUBY_VERSION > /dev/null; then
|
||||
printf "${RED}Open Food Network requires ruby ${RUBY_VERSION}${NO_COLOR}. Have a look at: https://github.com/rbenv/rbenv\n"
|
||||
RUBY_VERSION=$(cat .ruby-version)
|
||||
if command -v rbenv > /dev/null; then
|
||||
./script/rbenv-install.sh
|
||||
elif ! 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"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user