How to Install Samvera Hyrax on Manjaro

Samvera Hyrax is an open-source digital content management system that allows institutions to easily create digital repositories. Here's a step-by-step guide to installing Samvera Hyrax on your Manjaro system.

Prerequisites

Before we begin, you will need:

  • A Manjaro machine with root privileges
  • Ruby version 2.7 or higher

Installation

  1. Install the necessary dependencies by running the command below:

    sudo pacman -S git nodejs npm
    
  2. Install the PostgreSQL database server and the development headers:

    sudo pacman -S postgresql postgresql-libs postgresql-libs-static
    
  3. Create a new database role and database for Hyrax:

    sudo -iu postgres
    createuser -d -P hyrax
    createdb --owner=hyrax hyrax_development
    exit
    
  4. Install the RVM (Ruby Version Manager) and Ruby dependencies:

    gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
    curl -sSL https://get.rvm.io | bash -s stable --ruby
    source /etc/profile.d/rvm.sh
    rvm install 2.7.2
    rvm use 2.7.2 --default
    gem install bundler rails
    
  5. Clone the Hyrax repository:

    git clone https://github.com/samvera/hyrax.git
    cd hyrax
    
  6. Install all gem dependencies using Bundler:

    bundle install
    
  7. Initialize the Hyrax application:

    rails hyrax:install
    
  8. Configure the database by editing the config/database.yml file:

    default: &default
      adapter: postgresql
      encoding: unicode
      database: hyrax_development
      pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
      username: hyrax
      password: <%= ENV['HYRAX_DATABASE_PASSWORD'] %>
      host: localhost
    
    development:
      <<: *default
    
    test:
      <<: *default
      database: hyrax_test
    

    Replace the password value with the one you set when creating the hyrax database role.

  9. Prepare the database by running the following commands:

    rails db:migrate
    rails hyrax:default_collection_types:create
    rails hyrax:workflow:load
    
  10. Start the Hyrax server:

rails server

You can now access the Hyrax application by navigating to http://localhost:3000 in your browser.

Conclusion

Congratulations! You have successfully installed Samvera Hyrax on your Manjaro system. You can now start building your digital repository with Hyrax.