summaryrefslogtreecommitdiff
path: root/ruby.sh
diff options
context:
space:
mode:
authorAndreas Maunz <andreas@maunz.de>2011-03-29 12:57:21 +0200
committerAndreas Maunz <andreas@maunz.de>2011-03-29 12:57:21 +0200
commit0c926b09753901c446d9b5d82b8c3e9307fda887 (patch)
tree143c4174100f3d965365173b63f766a313d0ef28 /ruby.sh
parentbf309f52283db539ca1f8d9c004cad7eb88b2de4 (diff)
nginx install
Diffstat (limited to 'ruby.sh')
-rwxr-xr-xruby.sh28
1 files changed, 12 insertions, 16 deletions
diff --git a/ruby.sh b/ruby.sh
index ed424f2..fd00b2b 100755
--- a/ruby.sh
+++ b/ruby.sh
@@ -18,22 +18,18 @@ if [ ! -e "$WGET" ]; then
fi
# Pkg
-RUBYVER="ruby-enterprise-1.8.7-2011.03"
-PREFIX="$HOME/$RUBYVER"
+source ./config.sh
if [ -n "$1" ]; then
- PREFIX="$1"
+ RUBY_DEST="$1"
fi
-# Dest
-RUBY_CONF=$HOME/.bash_ruby_ot
-
-mkdir "$PREFIX" >/dev/null 2>&1
-if [ ! -d "$PREFIX" ]; then
- echo "Install directory '$PREFIX' is not available! Aborting..."
+mkdir "$RUBY_DEST" >/dev/null 2>&1
+if [ ! -d "$RUBY_DEST" ]; then
+ echo "Install directory '$RUBY_DEST' is not available! Aborting..."
exit 1
else
- if ! rmdir "$PREFIX" >/dev/null 2>&1; then # if not empty this will fail
- echo "Install directory '$PREFIX' is not empty. Skipping Ruby installation..."
+ if ! rmdir "$RUBY_DEST" >/dev/null 2>&1; then # if not empty this will fail
+ echo "Install directory '$RUBY_DEST' is not empty. Skipping Ruby installation..."
RUBY_DONE=true
fi
fi
@@ -41,16 +37,16 @@ fi
DIR="`pwd`"
if [ ! $RUBY_DONE ]; then
echo "This installs Ruby Enterprise edition."
- echo "Your installation directory is '$PREFIX'."
+ echo "Your installation directory is '$RUBY_DEST'."
echo "A configuration file is created and you are given the option to have it included in your '~.bashrc'."
echo "Press <Return> to continue, or <Ctrl+C> to abort."
read
cd /tmp
- if ! $WGET -O - "http://rubyenterpriseedition.googlecode.com/files/$RUBYVER.tar.gz" | tar zxv >/dev/null 2>&1 ; then
+ if ! $WGET -O - "http://rubyenterpriseedition.googlecode.com/files/$RUBY_VER.tar.gz" | tar zxv >/dev/null 2>&1 ; then
echo "Download failed! Aborting..."
exit 1
fi
- sh /tmp/$RUBYVER/installer --dont-install-useful-gems --no-dev-docs --auto="$PREFIX"
+ sh /tmp/$RUBY_VER/installer --dont-install-useful-gems --no-dev-docs --auto="$RUBY_DEST"
fi
echo
@@ -61,7 +57,7 @@ echo "Press <Return> to continue, or <Ctrl+C> to abort."
echo -n "Enter 's' to skip this step: "
read PASSENGER_SKIP
if [ "$PASSENGER_SKIP" != "s" ]; then
- export PATH="$PREFIX/bin:$PATH"
+ export PATH="$RUBY_DEST/bin:$PATH"
gem sources -a "http://gemcutter.org "
gem sources -r "http://rubygems.org/"
echo "gem: --no-ri --no-rdoc" | tee -a $HOME/.gemrc
@@ -72,7 +68,7 @@ cd "$DIR"
echo
echo "Preparing RUBY..."
if [ ! -f $RUBY_CONF ]; then
- echo "PATH=$PREFIX/bin:\$PATH" >> "$RUBY_CONF"
+ echo "PATH=$RUBY_DEST/bin:\$PATH" >> "$RUBY_CONF"
echo "Ruby configuration has been stored in '$RUBY_CONF'."
echo -n "Decide if Ruby configuration should be linked to your .bashrc ('y/n'): "
read ANSWER_JAVA_CONF