Skip to content

Instantly share code, notes, and snippets.

@midhunkrishna
Last active May 29, 2017 13:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save midhunkrishna/20c176bcaa9791696b6c72d3d471dd4a to your computer and use it in GitHub Desktop.
Save midhunkrishna/20c176bcaa9791696b6c72d3d471dd4a to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
if ! grep -q xenial /etc/lsb-release
then
echo "Adding PPA for up-to-date Node.js runtime. Give your password when asked."
# sudo add-apt-repository ppa:chris-lea/node.js
sudo add-apt-repository ppa:chris-lea/redis-server
else
: # Xenial not (yet, as of April 2016) supported by that ppa,
# use default distro node.js.
fi
echo "Updates packages. Asks for your password."
# sudo apt-get update -y
echo "Installs packages. Give your password when asked."
sudo apt-get --ignore-missing install build-essential git-core curl openssl libssl-dev libcurl4-openssl-dev zlib1g zlib1g-dev libreadline-dev libreadline6 libreadline6-dev libyaml-dev libxml2-dev libxslt1-dev python-software-properties libffi-dev libgdm-dev libncurses5-dev automake autoconf libtool bison postgresql-contrib-9.4 postgresql-9.4 libpq-dev pgadmin3 libc6-dev nodejs redis-server -y
echo "Installs ImageMagick for image processing"
sudo apt-get install imagemagick --fix-missing -y
echo "Installs RVM (Ruby Version Manager) for handling Ruby installation"
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
curl -sSL https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
echo "Installs Ruby"
rvm install 2.1.5
rvm use 2.1.5 --default
echo "gem: --no-ri --no-rdoc" > ~/.gemrc
gem install bundler
echo -e "\n- - - - - -\n"
echo -e "Now we are going to print some information to check that everything is done:\n"
echo -n "Should be rvm 1.26.11 or higher: "
rvm --version | sed '/^.*$/N;s/\n//g' | cut -c 1-11
echo -n "Should be ruby 2.1.5: "
ruby -v | cut -d " " -f 2
echo -e "\n- - - - - -\n"
source ~/.rvm/scripts/rvm
echo "If the versions match, everything is installed correctly. If the versions
don't match or errors are shown, something went wrong with the automated process
and we will help you do the installation the manual way.
Allow login shell, example http://rvm.io/integration/gnome-terminal/"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment