if [ "$(whoami)" != "root" ]; then
echo "You need to be root to run this!"
exit 2
fi
VERSION="1.2"
REEV="http://rubyforge.org/frs/download.php/51100/ruby-enterprise-1.8.6-20090201.tar.gz"
REEF="ruby-enterprise-1.8.6-20090201.tar.gz"
REEFF=${REEF%".tar.gz"}
PASSENGER="2.1.2"
export PASSENGER
echo "#####################################"
echo "Welcome, let’s get this party rollin’"
echo "#####################################"
echo "Updating Aptitude"
apt-get update
echo "Installing build essentials"
apt-get install build-essential zlib1g-dev libssl-dev wget libreadline5-dev -y
echo "Installing GIT"
apt-get install -y git-core
echo "Installing apache"
apt-get install -y apache2
echo "Installing apache headers"
apt-get install -y apache2-prefork-dev
echo "Installing Ruby Enterprise from following url"
echo $REEV
wget $REEV
if [ -e $REEF ]
then
echo "File downloaded succesful"
else
echo "Error, file wasn’t downloaded!"
exit
fi
tar -zxvf $REEF
# possible options perhaps for checker
# –extra rails –no-tcmalloc
if [ -d ./$REEFF ]
then
./$REEFF/installer –auto /opt/ruby
echo "Dir test"
else
echo "Dir not found, exiting.."
exit
fi
echo "Creating ruby symlinks"
ln -s /opt/ruby/bin/ruby /usr/bin/ruby
ln -s /opt/ruby/bin/gem /usr/bin/gem
ln -s /opt/ruby/bin/rake /usr/bin/rake
ln -s /opt/ruby/bin/rails /usr/bin/rails
echo "Installing other gems"
gem install rails
gem install will_paginate
gem install shoulda
gem install mysql
echo "Installing passenger"
gem install passenger -v=$PASSENGER
echo "Config passenger"
yes ” | /opt/ruby/bin/passenger-install-apache2-module
echo "Copying passenger files"
touch /etc/apache2/mods-available/passenger.load
touch /etc/apache2/mods-available/passenger.conf
echo "LoadModule passenger_module /opt/ruby/lib/ruby/gems/1.8/gems/passenger-$PASSENGER/ext/apache2/mod_passenger.so" >> /etc/apache2/mods-available/passenger.load
echo "PassengerRoot /opt/ruby/lib/ruby/gems/1.8/gems/passenger-$PASSENGER
PassengerRuby /opt/ruby/bin/ruby" >> /etc/apache2/mods-available/passenger.conf
echo "Enabling passenger module"
a2enmod passenger
echo "Reloading apache"
/etc/init.d/apache2 reload
echo "##########################"
echo "# Installation Complete"
echo "##########################"
sleep 2
echo "##########################"
echo "# Installed Ruby Version #"
echo "##########################"
ruby -v
echo "##########################"
echo "# Installed Gems Version #"
echo "##########################"
gem -v
/opt/ruby/bin/passenger-status
转至:http://gist.github.com/37213
original link:
<a href='http://Apiaceae.github.io/blog/2009/12/04/%E5%9C%A8UBUNTU%E4%B8%8B%E8%87%AA%E5%8A%A8%E5%AE%89%E8%A3%85rails%E8%BF%90%E8%A1%8C%E7%8E%AF%E5%A2%83/'>http://Apiaceae.github.io/blog/2009/12/04/%E5%9C%A8UBUNTU%E4%B8%8B%E8%87%AA%E5%8A%A8%E5%AE%89%E8%A3%85rails%E8%BF%90%E8%A1%8C%E7%8E%AF%E5%A2%83/</a><br/>
written by <a href='http://Apiaceae.github.io'>Hooker</a>
posted at <a href='http://Apiaceae.github.io'>http://Apiaceae.github.io</a>
</p>