forked from MunifTanjim/scripts.sh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup-rbenv
executable file
·33 lines (27 loc) · 926 Bytes
/
setup-rbenv
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env bash
# install/update rbenv
# https://github.com/rbenv/rbenv
_rbenv_dir="${HOME}/.rbenv"
if [[ -d "${_rbenv_dir}" ]]; then
echo "rbenv is already installed!"
echo "Updating rbenv..."
cd "${_rbenv_dir}" && git pull
else
echo "Installing rbenv..."
git clone https://github.com/rbenv/rbenv "${_rbenv_dir}"
cd "${_rbenv_dir}"
fi
echo "Installing build dependencies..."
sudo apt install -y autoconf bison build-essential libssl-dev libyaml-dev libreadline-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm6 libgdbm-dev
echo "Running build..."
src/configure && make -C src
_ruby_build_dir="${_rbenv_dir}/plugins/ruby-build"
if [[ -d "${_ruby_build_dir}" ]]; then
echo "ruby-build is already installed!"
echo "Updating ruby-build..."
cd "${_ruby_build_dir}" && git pull
else
echo "Installing ruby-build..."
git clone https://github.com/rbenv/ruby-build "${_ruby_build_dir}"
fi
echo "Done!"