-
Notifications
You must be signed in to change notification settings - Fork 4
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 Vagrant-based virtual machine easier.
- Set up a Hyrax-based Rails application
- Start Solr, Fedora, and Web servers
- Be able to log into a local Hyrax instance and submit a work
-
Generate a Hyrax application using the basic application template
rails _5.1.7_ new ucla2019 -m https://raw.githubusercontent.com/samvera/hyrax/v3.0.0.pre.beta1/template.rb
NOTE: using the template file above to set up your application is equivalent to running the following individual commands
- Run
rails _5.1.7_ new ucla2019
cd ucla2019
- Add
gem 'hyrax', '3.0.0-beta1'
to your Gemfile bundle install
rails generate hyrax:install -f
-
bundle install
to install newly added dependencies from Hyrax rails db:migrate
rails 'hyrax:default_collection_types:create'
- Run
-
Change directory to the root of the newly generated application
cd ucla2019
-
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
-
Add the following lines to the top of
ucla2019/.solr_wrapper
:version: 7.7.1 download_dir: /var/tmp
This will point your solr config at the local Solr instance in
/var/tmp
. -
Point your fedora config at the local Fedora instance in
/var/tmp
by adding these lines to the end ofucla2019/.fcrepo_wrapper
:version: 4.7.5 download_dir: /var/tmp
-
Generate the default admin set:
bundle exec rails hyrax:default_collection_types:create 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.
-
Add
fits.log
to yourucla2019/.gitignore
file around line 19. This will be automatically generated once you begin uploading works to your repository. -
Start Redis, Solr, Fedora, and Web servers, each in a new terminal window. You'll want to leave these running in separate windows while you use your first terminal session for command-line exercises in the tutorials.
In each new terminal session
cd /ucla2019 redis-server
cd /ucla2019 solr_wrapper
cd /ucla2019 fcrepo_wrapper
-
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 changes made during this lesson, go to ../compare/template_build...walkthrough Note: This also includes the changes added to be able to deploy using Docker.