-
Notifications
You must be signed in to change notification settings - Fork 319
Setting up Scumblr 2.0 (New install)
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
- 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
- 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
- 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
- Install ruby 2.3.1
rbenv install 2.3.1
rbenv global 2.3.1
- Install gems
gem install bundler --no-ri --no-rdoc
gem install sidekiq --no-ri --no-rdoc
- 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
Note: If you have an existing Postgres 9.4+ database you may skip these steps
- 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
- Setup a database user
sudo -u postgres createuser scumblr -s
- Setup a database password
sudo -u postgres psql
postgres=# \password scumblr
- At the prompts create a password
- Type '\q' to quit
- Run the following commands:
git clone https://github.com/Netflix/Scumblr.git
cd Scumblr
bundle install
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.
- 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
- Create the database
rake db:create
rake db:structure:load
- Setup an admin user
rails c
- In the console:
user = User.new
user.email = "<Valid email address>"
user.password = "<Password>"
user.password_confirmation = "<Password>"
user.admin = true
user.save
- 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 &
- Now connect to your server on port 3000 (http://localhost:3000 in a browser if running on your local machine).