Merge pull request #12305 from Pauloparakleto/feat/12297-rvm-support-script-setup

Feat/12297 rvm support script setup
This commit is contained in:
David Cook
2024-03-28 09:14:51 +11:00
committed by GitHub
2 changed files with 7 additions and 3 deletions

View File

@@ -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

View File

@@ -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