Blacklight is a Ruby on Rails Engine plugin, meaning it provides a small application that runs inside an existing Ruby on Rails project.
This Quickstart will walk you through installing Blacklight and Solr, and indexing a sample set of records. If you want information about configuring Blacklight to use an existing Solr index with your data in it, see the Developing Your Application section of the wiki.
To run Solr, you'll also need Java installed.
You should have Ruby 1.9 or greater installed.
$ ruby -version ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin13.0]
Blacklight works with Rails 3.2 and Rails 4.x, although we strongly encourage you to use Rails 4.
$ rails --version Rails 4.0.3
$ java -version java version "1.6.0_0" IcedTea6 1.3.1 (6b12-0ubuntu6.1) Runtime Environment (build 1.6.0_0-b12) OpenJDK Client VM (build 1.6.0_0-b12, mixed mode, sharing)
The output will vary, but you need to make sure you have version 1.6 or higher. If you don't have the required version, or if the java command is not found, download and install the latest version from Oracle at http://www.oracle.com/technetwork/java/index.html.
Create a new, blank Rails application
$ rails new my_new_blacklightapp ...
Append this line to your application's
gem 'blacklight', ">= 5.3.0"
Especially if you are running on Linux, you may have to add
then, update the bundle
$ bundle install
Install blacklight using Devise for user authentication:
$ rails generate blacklight:install --devise --marc --jettywrapper
--devise will also generate devise-based Users into your application. If you would prefer to integrate with an alternative user authentication provider, see the User Authentication documentation.
--marc will also generate
blacklight-marc into your application, which adds library-specific functionality out-of-the-box.
Run your database migrations to create Blacklight's database tables:
$ rake db:migrate
For the initial install of Blacklight you may need to download Jetty by running before starting it:
$ rake jetty:clean
Make sure your Solr server is running. If you installed the Blacklight using the
--jettywrapper option, you can start the Jetty/Solr server using:
$ rake jetty:start
Index some data. You can index test the MARC records provided with Blacklight by running:
$ rake solr:marc:index_test_data
Start up your application
$ rails server
Visit the catalog at http://localhost:3000/catalog.
You should see the Blacklight interface with 30 MARC records for testing. Additional MARC records are available from the blacklight-data repository. These can be ingested into Solr using SolrMarc,
$ rake solr:marc:index MARC_FILE=(path to file)
See Configuring and Customizing Blacklight for information about how to customize the Blacklight user interface, search experience, and more.
Last edited by Chris Beer,