Setting Up Your Local Development Environment (Mac OS X) - nycrecords/gpp-hyrax GitHub Wiki

Pre-Requisites

  1. Homebrew (https://brew.sh)
# If you don't have Homebrew installed, use the following command to install it.
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

# Update Homebrew, if it was already installed
brew update
  1. Imagemagick:
brew install imagemagick

# To confirm it JPEG-2000 support is installed
convert -list format | grep "JP2"
  1. LibreOffice
brew cask install libreoffice
  1. FITS
brew cask install adoptopenjdk
brew install fits
  1. Redis
brew install redis

# Set Redis to launch on boot
brew services start redis
  1. PostgreSQL
brew install postgres

# Set Postgres to start on boot
brew services start postgresql
  1. Java
brew install openjdk@8
echo 'export PATH="/usr/local/opt/openjdk@8/bin:$PATH"' >> ~/.zshrc
  1. rbenv and Ruby
# Install rbenv and ruby-build
brew install rbenv ruby-build

# Install Ruby 2.5.3
rbenv install 2.5.3

Setting up your application

  1. Clone the repository using RubyMine URL: https://github.com/nycrecords/gpp-hyrax.git

  2. Sets a local app Ruby version

rbenv local 2.5.3
  1. Install bundler
gem install bundler -v '2.0.1'
gem install bundler -v "$(grep -A 1 "BUNDLED WITH" Gemfile.lock | tail -n 1)" # Works if we update the bundler version in the Gemfile.lock
  1. Install gems
bundle install
  1. Setup your development db:
bundle exec rake db:migrate
  1. Run solr (separate terminal tab/window)
solr_wrapper
  1. Run fedora (separate terminal tab/window)
fcrepo_wrapper
  1. Create default hyrax resources
bin/rails hyrax:default_admin_set:create
bin/rails hyrax:default_collection_types:create
bundle exec rake hyrax:workflow:load
  1. Create the admin role and a user in the rails console
user = User.create(email: '[email protected]')
admin = Role.create(name: "admin")
admin.users << user
admin.save