mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
People may use other ways to provide the right Ruby version but if they use rbenv then we can use it automatically.
20 lines
530 B
Bash
Executable File
20 lines
530 B
Bash
Executable File
#!/bin/bash
|
|
#
|
|
# Install our selected Ruby version defined in the .ruby-version file.
|
|
#
|
|
# Requires:
|
|
# - [rbenv](https://github.com/rbenv/rbenv#readme)
|
|
# - [ruby-build](https://github.com/rbenv/ruby-build#readme)
|
|
#
|
|
# If our ruby-build version is outdated and it can't build the version we want
|
|
# then we try upgrading ruby-build and installing again.
|
|
|
|
if rbenv install --skip-existing; then
|
|
echo "Ruby is installed."
|
|
else
|
|
echo "Upgrading rbenv's ruby-build:"
|
|
git -C "$(rbenv root)"/plugins/ruby-build pull
|
|
|
|
rbenv install
|
|
fi
|