|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +set -e |
| 4 | + |
| 5 | +# If you decide to skip the full update, be sure to at least run 'sudo yum update audit -y' |
| 6 | +echo "Updates packages. Asks for your password." |
| 7 | +sudo pacman -Sy |
| 8 | + |
| 9 | +echo "Installs packages. Give your password when asked." |
| 10 | +sudo pacman -S --noconfirm base-devel patch libffi openssl readline curl git zlib libyaml sqlite libxml2 libxslt nodejs libgdm ncurses postgresql postgresql-libs |
| 11 | + |
| 12 | +echo "Installs ImageMagick for image processing" |
| 13 | +sudo pacman -S --noconfirm imagemagick |
| 14 | + |
| 15 | +echo "Installs RVM (Ruby Version Manager) for handling Ruby installation" |
| 16 | +gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 |
| 17 | +curl -sSL https://get.rvm.io | bash -s stable |
| 18 | +source ~/.rvm/scripts/rvm |
| 19 | + |
| 20 | +echo "Installs Ruby" |
| 21 | +rvm install 2.3.1 |
| 22 | +rvm use 2.3.1 --default |
| 23 | + |
| 24 | +gem install bundler --no-rdoc --no-ri |
| 25 | +gem install rails --no-rdoc --no-ri |
| 26 | + |
| 27 | +# Make sure RVM, Ruby and Rails are on the user's path |
| 28 | +echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"' >> ~/.bashrc |
| 29 | +set +e |
| 30 | +source ~/.bashrc |
| 31 | +set -e |
| 32 | + |
| 33 | +echo -n "Should be sqlite 3.8.1 or higher: sqlite " |
| 34 | +sqlite3 --version |
| 35 | +echo -n "Should be rvm 1.27.0 or higher: " |
| 36 | +rvm --version | sed '/^.*$/N;s/\n//g' | cut -c 1-10 | xargs echo |
| 37 | +echo -n "Should be ruby 2.3.1: " |
| 38 | +ruby -v | cut -d " " -f 2 |
| 39 | +echo -n "Should be Rails 5.0.0 or higher: " |
| 40 | +rails -v |
| 41 | +echo -e "\n- - - - - -\n" |
| 42 | + |
| 43 | +echo "If the versions match, everything is installed correctly. If the versions |
| 44 | +don't match or errors are shown, something went wrong with the automated process |
| 45 | +and we will help you do the installation the manual way at the event. |
| 46 | +
|
| 47 | +Congrats!" |
| 48 | + |
0 commit comments