Last updated: 01 June 2015
Work in progress
sources:
- "https://www.digitalocean.com/community/articles/how-to-install-ruby-on-rails-on-ubuntu-12-04-lts-with-rbenv--2"
- "http://10kb.nl/blog/setup-and-keep-up-with-the-latest-versions-of-a-complete-rails-dev-stack"
- "http://gorails.com/setup/ubuntu/13.10"
- "https://gorails.com/deploy/ubuntu/14.04"
- Edit
/etc/default/locale
as sudo. - Append
LC_ALL="en_GB.UTF-8"
at the end of the file, save and quit. sudo locale-gen en_GB en_GB.UTF-8
sudo dpkg-reconfigure locales
sudo apt-get update
sudo apt-get -y install build-essential bison openssl libreadline6 libreadline6-dev curl git-core
sudo apt-get -y install zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3
sudo apt-get -y install libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev libcurl4-openssl-dev
-
cd
-
git clone git://github.com/sstephenson/rbenv.git .rbenv
-
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
-
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
-
exec $SHELL
-
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
-
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
-
exec $SHELL
-
git clone https://github.com/sstephenson/rbenv-gem-rehash.git ~/.rbenv/plugins/rbenv-gem-rehash
-
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
-
git clone https://github.com/sstephenson/rbenv-vars.git ~/.rbenv/plugins/rbenv-vars
-
source ~/.bashrc
rbenv install 2.2.0
rbenv rehash
rbenv global 2.2.0
echo "gem: --no-ri --no-rdoc" > ~/.gemrc
gem install bundler
gem install rails -v 4.2.0
rbenv rehash
sudo apt-get update
sudo apt-get -y install nodejs
sudo apt-get install npm
gpg --keyserver keyserver.ubuntu.com --recv-keys 561F9B9CAC40B2F7
gpg --armor --export 561F9B9CAC40B2F7 | sudo apt-key add -
sudo apt-get install apt-transport-https
sudo sh -c "echo 'deb https://oss-binaries.phusionpassenger.com/apt/passenger trusty main' >> /etc/apt/sources.list.d/passenger.list"
sudo chown root: /etc/apt/sources.list.d/passenger.list
sudo chmod 600 /etc/apt/sources.list.d/passenger.list
sudo apt-get update
sudo apt-get install nginx-extras passenger
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get -y install postgresql libpq-dev postgresql-contrib
sudo passwd postgres
and enter password 2 timessu -l postgres
psql
postgres=# ALTER USER postgres WITH PASSWORD 'secr3t';
ALTER ROLE
postgres=# CREATE ROLE postgres LOGIN CREATEDB
postgres-# \q
- Edit
/etc/postgresql/9.4/main/pg_hba.conf
and find this line:
# Database administrative login by Unix domain socket
local all postgres peer
- Change it to this:
# Database administrative login by Unix domain socket
local all postgres md5
/etc/init.d/postgresql restart