Setting Up Your Local Development Environment (Mac OS X) - nycrecords/gpp-hyrax GitHub Wiki
Pre-Requisites
- 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
- Imagemagick:
brew install imagemagick
# To confirm it JPEG-2000 support is installed
convert -list format | grep "JP2"
- LibreOffice
brew cask install libreoffice
- FITS
brew cask install adoptopenjdk
brew install fits
- Redis
brew install redis
# Set Redis to launch on boot
brew services start redis
- PostgreSQL
brew install postgres
# Set Postgres to start on boot
brew services start postgresql
- Java
brew install openjdk@8
echo 'export PATH="/usr/local/opt/openjdk@8/bin:$PATH"' >> ~/.zshrc
- 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
-
Clone the repository using RubyMine URL: https://github.com/nycrecords/gpp-hyrax.git
-
Sets a local app Ruby version
rbenv local 2.5.3
- 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
- Install gems
bundle install
- Setup your development db:
bundle exec rake db:migrate
- Run solr (separate terminal tab/window)
solr_wrapper
- Run fedora (separate terminal tab/window)
fcrepo_wrapper
- Create default hyrax resources
bin/rails hyrax:default_admin_set:create
bin/rails hyrax:default_collection_types:create
bundle exec rake hyrax:workflow:load
- 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