Skip to content

Instantly share code, notes, and snippets.

@billdueber
Last active May 25, 2017 17:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save billdueber/e17fbf5e323da2fe5e56c5c17096d0f5 to your computer and use it in GitHub Desktop.
Save billdueber/e17fbf5e323da2fe5e56c5c17096d0f5 to your computer and use it in GitHub Desktop.

Install a skeleton Rails app with Hyrax

(from Seth Johnson)

$ ruby -v
    => ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linu

$ rails -v
    => Rails 5.0.2
  1. rails new my_app -m https://raw.githubusercontent.com/projecthydra-labs/hyrax/master/template.rb This will give you a directory called "my_app". if you don't like that, edit the above command with your own project name.
  2. rails generate hyrax:work Work
  3. bundle exec rake hyrax:workflow:load
  4. Now start the app (solr, fedora, etc): bundle exec rake hydra:server
  5. Go to http://0.0.0.0:3000. Is the app up? It was for me.
  6. In a new terminal, in my_app (or whatever): bundle exec rake hyrax:default_admin_set:create
  7. Now make a new user: http://127.0.0.1:3000/users/sign_up?locale=en
  8. Next, make that user an admin. Shutdown the server (in the window you ran bundle exec rake hydra:server do a ^C.
  9. Edit config/role_map.yaml and add your user as an admin. How to do that is here: but it's really just:
development:
    ...
    admin:
      - my_fake_user@faker.com
  1. Start up the server: bundle exec rake hydra:server and go to http://0.0.0.0:3000
  2. You should see an "Administration" link in the top left corner. You can click that, 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment