This repository has been archived by the owner on Sep 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
4_install_gems.sh
104 lines (86 loc) · 1.59 KB
/
4_install_gems.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#! /bin/bash
SCRIPT=`basename $0`
ERROR=1
SUCCESS=0
SEPERATOR="~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
usage()
{
echo "$SCRIPT: usage: $SCRIPT "
}
if [ `id -u` -eq 0 ]
then
echo "$SCRIPT: ERROR: Script cannot be run as root or with sudo."
exit $ERROR
fi
while getopts ":h" opt; do
case $opt in
h)
usage
exit $SUCCESS
;;
\?)
echo "$SCRIPT: Invalid option: -$OPTARG" >&2
usage
exit $ERROR
;;
:)
echo "$SCRIPT: Option -$OPTARG requires an argument." >&2
usage
exit $ERROR
;;
esac
done
echo "$SCRIPT: Updating RVM..."
rvm get latest
if [ $? -eq 0 ]
then
echo "$SCRIPT: RVM updated."
else
echo "$SCRIPT: ERROR: RVM could not be updated." >&2
exit $ERROR
fi
echo "$SEPERATOR"
echo "$SCRIPT: Updating Gems..."
gem update --system
if [ $? -eq 0 ]
then
echo "$SCRIPT: Gems updated."
else
echo "$SCRIPT: ERROR: Gems could not be updated." >&2
exit $ERROR
fi
gem -v
echo "$SEPERATOR"
echo "$SCRIPT: Updating Rake..."
gem update rake
if [ $? -eq 0 ]
then
echo "$SCRIPT: Rake updated."
else
echo "$SCRIPT: ERROR: Rake could not be updated." >&2
exit $ERROR
fi
rake --version
echo "$SEPERATOR"
#echo "$SCRIPT: Installing bundler."
#gem install bundler
#if [ $? -eq 0 ]
#then
# echo "$SCRIPT: Bundler installed."
#else
# echo "$SCRIPT: ERROR: Bundler could not be installed." >&2
# exit $ERROR
#fi
echo "$SEPERATOR"
echo "$SCRIPT: Installing rails."
gem install rails
if [ $? -eq 0 ]
then
echo "$SCRIPT: rails installed."
else
echo "$SCRIPT: ERROR: Bundler could not be installed." >&2
exit $ERROR
fi
echo "$SEPERATOR"
rvm reload
exit $SUCCESS