Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
RVM Mysql Posgres Linux automated script
echo "Updates packages. Asks for your password."
sudo apt-get update -y
echo "Installs packages. Give your password when asked."
sudo apt-get install -y curl nodejs libcurl4-gnutls-dev git-core libxslt1-dev libxml2-dev libsqlite3-dev libgmp-dev libmysqlclient-dev git git-doc libncurses5-dev build-essential rake libqt4-dev libqtwebkit-dev openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion pkg-config libv8-dev libmagickwand-dev libreadline-dev libedit-dev libgdbm-dev libffi-dev zlib1g-dev rake curl vim libgmp3-dev
echo "Setting up mysql"
sudo apt-get install -y mysql-server mysql-client
echo "Setting up postgres"
sudo apt-get install postgresql-9.3 pgadmin3 postgresql-contrib-9.3 postgresql-server-dev-9.3
#sudo apt-get install postgresql-9.5 pgadmin3 postgresql-contrib-9.5 postgresql-server-dev-9.5 postgis postgresql-9.5-postgis-2.2
echo "Installs RVM (Ruby Version Manager) for handling Ruby installation"
echo insecure >> ~/.curlrc
command curl -sSL https://rvm.io/mpapis.asc | gpg2 --import -
\curl -sSL https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
echo "Saving rvm function into bashrc"
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bashrc
source ~/.bashrc
echo "Installs Ruby"
rvm install 2.4.1
rvm use 2.4.1 --default
gem install bundler --no-rdoc --no-ri
gem install rails --no-rdoc --no-ri
echo "Congrats! You are all set with Ruby and MySQL/Sqlite"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.