CURIOSity enables researchers to discover and easily access a wealth of curated, publicly accessible, digitized materials.
Ruby on Rails
Blacklight / Spotlight
git clone git@github.com:harvard-lts/CURIOSity.git- Make a copy of the config example file
./env-example - Rename the file to
.env - Replace placeholder values as necessary
Note: The config file .env is specifically excluded in .gitignore and .dockerignore, since it contains credentials it should NOT ever be committed to any repository.
cp docker-compose.override.example.yml docker-compose.override.ymldocker compose build
docker compose -f docker-compose.yml -f docker-compose.override.yml up -d --build --force-recreate
After running the above commands, check that you see the following output in the terminal, then navigate to https://localhost:21407/
curiosity-db_migrate-1 exited with code 0
You can find login credentials in the db/seeds.rb file. These SHOUDL NOT be brought in to anything beyond local.
To import these:
docker exec -it harvard-curiosity-web-1 sh
bundle exec rails db:migrate
bundle exec rails db:seedBash into the web container
docker compose exec web sh
Create & migrate the test database
RAILS_ENV=test bin/rails db:create db:migrate
Run your specs (this will run the whole test suite, if you would like to run an individual test, add the relative path to the end.)
bin/rspec
- If you get the following error when navigating to http://spotlight.test:
NoMethodError in Spotlight::ExhibitsController#index
undefined method `current_exhibit = 'for I18n::Backend::ActiveRecord::Translation(Table doesn't exist):ClassTry: restarting the containers or shelling in and re-running migrations
- If you run into this error the first time you are running the test suite
ActiveRecord::NoDatabaseError:
connection to server at "192.168.32.2", port 5432 failed: FATAL: database "spotlight_test" does not existTry:
- Comment out lines 8-23 in
config/initializers/translation.rb - Comment out lines 27-32 in
spec/rails_helper.rb - Run the command to create and migrate the test db again:
RAILS_ENV=test bin/rails db:create db:migrate