Skip to content

Manual install on Linux

Andrew Cain edited this page Apr 9, 2021 · 16 revisions

Contents

1. Install rbenv and ruby-build

Make sure you have git installed, along with a C compiler, and a few other tools you will need. For example:

sudo apt update
sudo apt-get install -y git build-essentials git curl python

Install rbenv and ruby-build:

cd ~
git clone git://github.com/sstephenson/rbenv.git .rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc

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

note: if you're using zsh (with tools like Oh-My-Zsh), add to your .zshrc:

echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(rbenv init -)"' >> ~/.zshrc
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.zshrc

Now install Ruby v2.6.7:

sudo apt-get install -y libssl-dev zlib1g-dev libreadline-dev
rbenv install 2.6.7

2. Install Postgres

Install Postgres:

sudo apt-get install postgresql \
                     postgresql-contrib \
                     libpq-dev

Ensure pg_config is on the PATH, and then login to Postgres. You will need to locate where apt-get has installed your Postgres binary and add this to your PATH. You can use whereis psql for that, but ensure you add the directory and not the executable to the path

whereis pqsl
export PATH=/usr/bin:$PATH
sudo -u postgres createuser --superuser $USER
sudo -u postgres createdb $USER
psql

Create the Doubfire user the following at the Postgres prompt:

CREATE ROLE itig WITH CREATEDB PASSWORD 'd872$dh' LOGIN;

3. Install native tools

Install imagemagick, libmagic and ghostscript. You will also need to install the Python pygments package:

sudo apt-get install ghostscript \
                     imagemagick \
                     libmagickwand-dev \
                     libmagic-dev \
                     python3-pygments

4. Install Doubtfire API dependencies

Clone project and change your working directory to the api:

git clone https://github.com/doubtfire-lms/doubtfire-api.git
cd ./doubtfire-api

Then install Doubtfire API dependencies using bundler:

gem install bundler -v1.17
rbenv rehash
bundle install --without production replica staging

5. Create and populate Doubtfire

Whilst still in the Doubtfire API project root, execute:

bundle exec rake db:create

You can choose to populate the database with some fake test data using:

bundle exec rake db:populate

6. Install LaTeX to generate PDFs

Follow the Generating PDFs guide to assist with installing LaTeX to generate PDFs. This step is optional unless you wish to generate PDF submissions.