There are 3 parts to this document: MacOS X system setup, Ubuntu system setup, and Application setup. You’ll need to complete one of the system setups, and then the application setup after that.
MacOS X system setup
First install homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
You then need to install Command Line Tools for XCode from https://developer.apple.com/downloads.
With that done, use Homebrew to install Git and PostgreSQL
brew install git postgresql pkgconfig brew install ImageMagick --with-perl brew services start postgresql
And that’s it. You can jump to ‘Install ruby’
Ubuntu system setup
sudo apt-get update sudo apt-get install postgresql postgresql-contrib build-essential \ libssl-dev libreadline-dev zlib1g-dev \ libpq-dev libffi-dev libmagickwand-dev \ imagemagick python
I recommend that you install ruby via rbenv, this gives you the flexiblity required to install and switch between various versions of ruby.
Follow the installation steps for rbenv from https://github.com/sstephenson/rbenv#installation.
Then install ruby-build like so:
mkdir -p "$(rbenv root)"/plugins git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build
When a new version of ruby is released, you can update ruby-build with
cd "$(rbenv root)"/plugins/ruby-build && git pull
At the time of writing 2.5.1 is the version of ruby that Loomio uses. To check what the current version required is, see .ruby-version
rbenv install 2.6.6 rbenv global 2.6.6 gem install bundler
You’ll need Node.js and I recommend you use nvm to install it. Just run:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
You’ll need to restart your terminal, then run:
nvm install stable nvm alias default stable
Fork and clone the Loomio git repo
I recommend you visit https://github.com/loomio/loomio then click “Fork” to create your own loomio repository to work from.
In my case my forked repo is available at https://github.com/robguthrie/loomio and I use the SSH based url to clone the repo to my computer:
cd ~/projects # or wherever you like to keep your code git clone email@example.com:robguthrie/loomio.git && cd loomio
Install ruby and node dependencies
From you freshly checked out Loomio repo:
bundle install cd vue; npm install && cd ..
cp config/database.example.yml config/database.yml
On Linux you’ll need to create a postgres user with the same name as your Linux user account. This is not required on MacOS as it’s automatic.
sudo postgres -c 'createuser -P --superuser <username>'
Setup the Loomio database and schema
Launch rails and gulp
USE_VUE=1 rails s
And in a new terminal instance
cd vue npm run serve
You can view Loomio in your browser by visiting http://localhost:8080.
To view Loomio’s features and changes to your source code, visit any of the dev routes listed at http://localhost:8080/dev/ (be sure to include the trailing slash). A good place to is http://localhost:8080/dev/setup_group.
Other things to know
rails sand similar commands will fail. Try with
bundle exec rails sand that can help.
rails cwill bring up a rails console
- ‘rspec’ will run the rails tests
Let us know in the product development group on Loomio.