diff --git a/GETTING_STARTED.md b/GETTING_STARTED.md index 461aa86f53..59d65b526a 100644 --- a/GETTING_STARTED.md +++ b/GETTING_STARTED.md @@ -29,7 +29,7 @@ Fetch the latest version of `master` from `upstream` (ie. the main repo): This project needs specific ruby/bundler versions as well as node/yarn specific versions. For a local setup you will need: * Install or change your Ruby version according to the one specified at [.ruby-version](https://github.com/openfoodfoundation/openfoodnetwork/blob/master/.ruby-version) file. - - To manage versions, it's recommended to use [rbenv](https://github.com/rbenv/rbenv). + - To manage versions, it's recommended to use [rbenv](https://github.com/rbenv/rbenv) or [RVM](https://rvm.io/). * Install [nodenv](https://github.com/nodenv/nodenv) to ensure the correct [.node-version](https://github.com/openfoodfoundation/openfoodnetwork/blob/master/.node-version) is used. - [nodevn](https://github.com/nodenv/nodenv) is recommended as a node version manager. * PostgreSQL database diff --git a/script/setup b/script/setup index d8f03ae63b..b016f5d5b0 100755 --- a/script/setup +++ b/script/setup @@ -21,9 +21,13 @@ NO_COLOR='\033[0m' 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 +elif command -v rvm > /dev/null; then + rvm install $RUBY_VERSION +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