Skip to content

Setting up Scumblr 2.0 (New install)

Scott Behrens edited this page Jul 30, 2018 · 8 revisions

Table of Contents

Setup

This section will walkthrough a basic setup for Scumblr 2.0 on a base Ubuntu 14.04 system. This guide assumes you have an Ubuntu system setup and available to go. Instructions are adapted: from https://gorails.com/setup/ubuntu/14.04

Note: If you're upgrading from a previous version of Scumblr. See the upgrade instructions

Note: If you're setting up a system for testing/development you can run the following to set an environment variable that specifies to operate in the development environment:

export RAILS_ENV=development

Install Prerequisites

  1. From the command line run the following commands
sudo apt-get update
sudo apt-get 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 libmagickcore-dev libmagickwand-dev imagemagick imagemagick-common redis-server
  1. Install Bandit for python static code analysis (optional). Run the following from the command line
sudo apt-get install python-dev python-pip
sudo pip install bandit

Setup Ruby

  1. Install rbenv:
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
exec $SHELL

git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
exec $SHELL
  1. Install ruby 2.3.1
rbenv install 2.3.1
rbenv global 2.3.1
  1. Install gems
gem install bundler --no-ri --no-rdoc
gem install sidekiq --no-ri --no-rdoc

Install Rails

  1. From the command line run the following commands:
sudo apt-get install -y nodejs

gem install rails -v 4.2.6 --no-ri --no-rdoc
rbenv rehash

Install Postgres

Note: If you have an existing Postgres 9.4+ database you may skip these steps

  1. Run the following commands:
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 update
sudo apt-get install postgresql-common
sudo apt-get install postgresql-9.5 libpq-dev
  1. Setup a database user
sudo -u postgres createuser scumblr -s
  1. Setup a database password
sudo -u postgres psql
postgres=# \password scumblr
  1. At the prompts create a password
  2. Type '\q' to quit

Get scumblr

  1. Run the following commands:
git clone https://github.com/Netflix/Scumblr.git
cd Scumblr
bundle install

Secrets

You should generate secrets for the Rails Application and Devise using:

rake secret

Run this command three times to create three new secrets. In config/initializers/secret_token.rb replace Scumblr::Application.config.secret_token and Rails.application.config.secret_key_base. In devise.rb replace config.secret_key.

Setup Database

  1. Edit the config/database.yml to point to your database. Example (update to match your username, password, host and database name):
development:
        adapter: postgresql
        host: localhost
        port: 5432
        username: scumblr
        password: scumblr
        database: scumblr_dev
        pool: 5
        timeout: 5000
  1. Create the database
rake db:create
rake db:structure:load

Initial Setup

  1. Setup an admin user
rails c
  1. In the console:
user = User.new
user.email = "<Valid email address>"
user.password = "<Password>"
user.password_confirmation = "<Password>"
user.admin = true
user.save

Start Scumblr

  1. From the command line from the Scumblr root folder:
redis-server &
bundle exec sidekiq -l log/sidekiq.log &
bundle exec rails s -b 0.0.0.0 &
  1. Now connect to your server on port 3000 (http://localhost:3000 in a browser if running on your local machine).
Clone this wiki locally