-
Notifications
You must be signed in to change notification settings - Fork 0
/
mac_rails_dev_env.sh
31 lines (28 loc) · 1.21 KB
/
mac_rails_dev_env.sh
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
#!/bin/bash
#Mac OS Rails development enviroment setup automation script for essential tools.
TOOLS_ARRAY=( "XCode:xcode-select --install"
'install Brew:/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" && brew tap homebrew/dupes && brew install libxml2 libxslt libiconv && brew update'
'install rvm:gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3\curl -sSL https://get.rvm.io && source ~/.rvm/scripts/rvm'
'Ruby 2.3.1:rvm install 2.3.1'
'Rails 4.2.7:gem install rails 4.2.7'
'Bundler:gem install bundler'
'Git:brew install git'
'MySQL:brew install mysql && mysql.server start && mysql_secure_installation'
'PostgreSQL: brew install postgresql'
'Redis:brew install redis'
)
for tool in "${TOOLS_ARRAY[@]}" ; do
TOOL_NAME=${tool%%:*}
INSTALL_COMMAND=${tool#*:}
while true; do
read -p "Do want to install $TOOL_NAME? (yes/no) ";
if [[ $REPLY == y* || $REPLY == Y* ]]; then
eval $INSTALL_COMMAND
break;
elif [[ $REPLY == n* || $REPLY == N* ]]; then
break;
else
echo "Dude, please enter yes or no."
fi
done
done