Skip to content

Latest commit

 

History

History
71 lines (64 loc) · 2.42 KB

Build.md

File metadata and controls

71 lines (64 loc) · 2.42 KB

Build Sharedlists

This document describes how to setup Sharedlists within your local system. If you want to run Sharedlists in production you have to setup the following environment variables:

  • RAILS_ENV=production
  • SECRET_KEY_BASE=abc....

System requirements:

Getting started

  1. Clone the repository from GitHub:

    git clone https://github.com/foodcoops/sharedlists.git
    
  2. Install and setup rbenv and Bundler. For Debian/Ubuntu:

    sudo apt install rbenv libyaml-dev
    

    For other distributions have a look at the rbenv documentation.

  3. Add the following line to your .bashrc:

     eval "$(rbenv init -)"
    
  4. Install ruby-build:

    git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build
  5. Change to the Sharedlists directory and install the recommended Ruby version:

    rbenv install "$(cat .ruby-version)"
    
  6. Now you can install Bundler:

    rbenv exec gem install bundler
    
  7. Install system dependencies. For Debian/Ubuntu, that's:

    sudo apt install libv8-dev default-libmysqlclient-dev libxml2-dev libxslt1-dev libffi-dev libreadline-dev libmagic-dev

    For CentOS/Redhat you need:

     sudo yum install v8 community-mysql-devel libxml2-devel libxslt-devel libffi-devel readline-devel file-devel
  8. Install Ruby dependencies:

    rbenv exec bundle install
    
  9. Copy config/database.yml.SAMPLE to config/database.yml, adapt to your needs and setup your database:

    rbenv exec bundle exec rails db:setup
    
  10. Precompile all assets:

    rbenv exec bundle exec rails assets:precompile
    
  11. Start the rails server by running:

    rbenv exec bundle exec rails s
    
  12. Open your favorite browser and open the web browser at http://localhost:3000/

  13. Login using the default credentials: [email protected]/secret

  14. For a production setup you run Sharedlists as a systemd service. You will find more information here.