Skip to content

Instantly share code, notes, and snippets.

@billdueber
Last active April 8, 2017 15:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save billdueber/3ed639846c3fb1783e89c0a2e1abb166 to your computer and use it in GitHub Desktop.
Save billdueber/3ed639846c3fb1783e89c0a2e1abb166 to your computer and use it in GitHub Desktop.

Install using a template:

This is slighly different in that it installs the gems inside the app directory in yourappname/.bundle and uses native libxml2 to compile nokogiri.

$ ruby -v # need a 2.3 or later
   => 2.4.0
$ rails -v # 
   => 5.0.2

If you don't have rails (or don't have the right verison of rails), do gem install rails.

Then, create the new project (I call mine "thyrax", for "test hyrax")

rails new thyrax -B -m https://gist.githubusercontent.com/billdueber/3ed639846c3fb1783e89c0a2e1abb166/raw/d18dd0c5c486d96b47d8b49fae593d6a4b20da07/hyrax_template

Watch the world go by.

Post-template installation instructions

Wait! There's still work to do!

First, we need to create a new admin set. This requires the servers to be running.

  • Go to a second terminal and fire them up:
  cd whereever/thyrax # or whatever you called it
  bundle exec rake hydra:server

(this will take a lot of time, since it'll download solr and fedora and stuff)

  • Then, after the servers are running, create the admin set
  # again, from within the thyrax dir
  bundle exec rake hyrax:default_admin_set:create
  • Now make a new user in the web interface: http://127.0.0.1:3000/users/sign_up?locale=en
  • Make that user an admin.
    • Shutdown the server (in the window you ran bundle exec rake hydra:server do a ^C.)
    • Edit config/role_map.yaml and add your user as an admin. NOTE: You'll probably have to add the top-level admin key under development
    development:
        ...
        admin:
          - my_fake_user@faker.com
    
  • Start up the server again: bundle exec rake hydra:server. It'll be faster this time since it doesn't have to download everything.
  • Go to http://0.0.0.0:3000 and log in using the link in the upper-right.

If it all worked, you should be able to see and click on an "Administration" menu, then the "Administrative Sets" link and you should see a "Default Admin Set" link. Click that and then click "Edit". Click "Workflow". That's what we're going to be talking about a lot on Monday.

gem 'hyrax', '1.0.0.rc1'
say_status :bundler_config, "Going to build nokogiri with system libraries"
ENV['BUNDLE_BUILD__NOKOGIRI'] = "--use-system-libraries"
say_status :bundler_config, "Running bundler"
run 'bundle install --path=./.bundle'
generate 'hyrax:install', '-f'
rails_command 'db:migrate'
rails_command 'hyrax:workflow:load'
generate :"hyrax:work", "Work"
say_status "More to do!", "Continue with the instructions at https://gist.github.com/billdueber/3ed639846c3fb1783e89c0a2e1abb166"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment