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:
-
Clone the repository from GitHub:
git clone https://github.com/foodcoops/sharedlists.git
-
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.
-
Add the following line to your
.bashrc
:eval "$(rbenv init -)"
-
Install ruby-build:
git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build
-
Change to the Sharedlists directory and install the recommended Ruby version:
rbenv install "$(cat .ruby-version)"
-
Now you can install Bundler:
rbenv exec gem install bundler
-
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
-
Install Ruby dependencies:
rbenv exec bundle install
-
Copy
config/database.yml.SAMPLE
toconfig/database.yml
, adapt to your needs and setup your database:rbenv exec bundle exec rails db:setup
-
Precompile all assets:
rbenv exec bundle exec rails assets:precompile
-
Start the rails server by running:
rbenv exec bundle exec rails s
-
Open your favorite browser and open the web browser at http://localhost:3000/
-
Login using the default credentials:
[email protected]/secret
-
For a production setup you run Sharedlists as a systemd service. You will find more information here.