INSTALL-LINUX
#Development installation for Ubunutu 12.04 LTS
#set locale - this section is probably only needed if you're using the vagrant precise64 box
#and will need to happen before you install postgres
export LANGUAGE="en_US.UTF-8"
export LANG="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
#then run:
sudo locale-gen en_US.UTF-8
sudo dpkg-reconfigure locales
#install deps
sudo apt-get update
sudo apt-get install postgresql postgresql-contrib libpq-dev libxslt-dev libxml2-dev git build-essential libssl-dev zlib1g-dev libcurl4-openssl-dev nodejs libreadline-dev
#install rbenv
git clone git://github.com/sstephenson/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
exec $SHELL
#install ruby-build
mkdir ~/.rbenv/plugins
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
exec $SHELL
#install ruby and bundler
rbenv install 2.6.5
rbenv rehash
#set your global ruby
rbenv global 2.6.5
gem install bundler
rbenv rehash
#set up your username as a local postgres superuser
sudo -u postgres createuser --superuser `logname`
sudo vi /etc/postgresql/9.3/main/pg_hba.conf
#in the document you just opened, change this line:
#host all all 127.0.0.1/32 md5
#to look like this:
#host all all 127.0.0.1/32 trust
#this will make it so a password isn't needed for connections from localhost
#if you prefer, you can assign a password to your user and fill
#it in the config/database.yml file in the development section
#restart postgres
sudo /etc/init.d/postgresql restart
#setup dgidb
git clone https://github.com/genome/dgi-db.git dgi-db
cd dgi-db
bundle install
rbenv rehash
rake dgidb:load_local
#Occasionally the database may get into a confused state and this rake command no longer works properly
#In that case you can try this:
psql -h localhost -d dgidb -f db/structure.sql
psql -h localhost -d dgidb -f data/data.sql
#start the development server
rails s
#visit localhost:3000 to view the site