Skip to content

Instantly share code, notes, and snippets.

@gbpereira
Created October 17, 2016 00:36
Show Gist options
  • Save gbpereira/64deb733f36251de80d74938bc5869ce to your computer and use it in GitHub Desktop.
Save gbpereira/64deb733f36251de80d74938bc5869ce to your computer and use it in GitHub Desktop.
#!/bin/bash
GEMSET_NAME=seccomp
RAILS_VERSION=4.2.3
RUBY_VERSION=2.2.3
while [ $# -gt 0 ]; do
case "$1" in
--gemset=*)
GEMSET_NAME="${1#*=}"
;;
--ruby=*)
RUBY_VERSION="${1#*=}"
;;
--rails=*)
RAILS_VERSION="${1#*=}"
;;
*)
exit_with_error 1 "Parametro desconhecido '$1'"
esac
shift
done
# instalacao das dependencias
sudo apt-get install gawk g++ libreadline6-dev zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 autoconf libgdbm-dev libncurses5-dev automake libtool bison libffi-dev libxslt-dev libxml2-dev zlib1g-dev libgmp-dev build-essential
# instalacao da rvm
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
\curl -sSL https://get.rvm.io | bash
# instalacao do ruby e do rails
rvm install $RUBY_VERSION
rvm use $RUBY_VERSION
rvm gemset use $RUBY_VERSION@$GEMSET_NAME --create
gem install rails -v $RAILS_VERSION
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment