-
Notifications
You must be signed in to change notification settings - Fork 1
Building from Scratch
This guide walks you through the steps to set up a template-generated instance of Hyrax which can be used with the other tutorials in this Wiki. We have followed the main outline of the instructions in the Hyrax README, and we have added the steps to make using a docker-based environment easier.
- Set up a Hyrax-based Rails application
- Be able to log into a local Hyrax instance and submit a work
- Successfully complete instructions at Running in californica docker...
-
Your container should be running and you should be at a prompt that looks like
root@0bb51af4e22d:/californica#
-
Generate a Hyrax application using the basic application template
rails _5.1.6_ new hyrax_demo -m https://raw.githubusercontent.com/samvera/hyrax/v2.3.3/template.rb --no-spring
NOTE: using the template file above to set up your application is equivalent to running the following individual commands
- Run
rails _5.1.6_ new hyrax_demo --no-spring
cd hyrax_demo
- Add
gem 'hyrax', '2.3.3'
to your Gemfile bundle install
rails generate hyrax:install -f
rails db:migrate
- Run
-
Change directory to the root of the newly generated application
cd hyrax_demo
-
For the tutorials, set background jobs to run inline by editing
config/application.rb
around line 11# after the line # class Application < Rails::Application config.active_job.queue_adapter = :inline
-
Configure the application to use the SOLR container by editing
config/solr.yml
and updating the ports to match the ones in./docker-compose.yml
-
Make the same changes to
config/blacklight.yml
by updating the ports to match the ones in./docker-compose.yml
-
Configure the application to use the Fedora container by editing
config/Fedora.yml
and updating the ports to match the ones in./docker-compose.yml
-
Generate the default admin set:
bundle exec rails hyrax:default_admin_set:create
-
Create a work type to be used in future tutorials. To generate a new work type, we follow the instructions in the Hyrax README. In this case, our work type will be Image.
bundle exec rails generate hyrax:work Image
Restart Rails after generating a new work type, if Rails was running already.
-
Open a browser window and go to
http://localhost:3000
. You should be able to create an account and log in. Once you have logged in, go tohttp://localhost:3000/concern/images/new
. You should be able to submit a new Work object.
To see the sample application at this stage, go to https://github.com/RepoCamp/berlin2018/tree/walkthrough