Skip to content

Instantly share code, notes, and snippets.

@gentamura

gentamura/setup.sh

Last active Dec 15, 2017
Embed
What would you like to do?
#!/bin/sh
# Ubuntu setup from vagrant
###### via https://gorails.com/setup/ubuntu/14.04
echo "Packages setting..."
sudo apt-get -y update
sudo apt-get -y install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev
## Ruby
echo "Ruby setting..."
cd
git clone git://github.com/sstephenson/rbenv.git .rbenv
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
git clone https://github.com/sstephenson/rbenv-gem-rehash.git ~/.rbenv/plugins/rbenv-gem-rehash
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
echo 'gem: --no-ri --no-rdoc' > ~/.gemrc
~/.rbenv/bin/rbenv install 2.2.3
~/.rbenv/bin/rbenv global 2.2.3
~/.rbenv/versions/2.2.3/bin/gem install bundler
## Nodejs
echo "Nodejs setting..."
sudo add-apt-repository -y ppa:chris-lea/node.js
sudo apt-get -y update
sudo apt-get -y install nodejs
## PostgreSQL
echo "PostgreSQL setting..."
sudo sh -c "echo 'deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main' > /etc/apt/sources.list.d/pgdg.list"
wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get -y update
sudo apt-get -y install postgresql-common
sudo apt-get -y install postgresql-9.3 libpq-dev
sudo -u postgres createuser vagrant -s
sudo -u postgres psql << END_OF_INPUT
\password vagrant
END_OF_INPUT
## Redis
echo "Redis setting..."
sudo apt-get -y install tcl8.5
wget http://download.redis.io/releases/redis-stable.tar.gz
tar xzf redis-stable.tar.gz
cd redis-stable
make
make test
sudo make install
cd utils
sudo ./install_server.sh
## Rails
echo "Rails presetting..."
sudo chown -R vagrant:vagrant /usr/local/src/bundles
echo "Setup finished."
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.