projectblacklight / blacklight

Blacklight provides a discovery interface for any Solr (http://lucene.apache.org/solr) index.
http://projectblacklight.org/
Other
757 stars 256 forks source link

Indexing MARC records step fails in Quickstart guide #3081

Open mephillips-durham opened 10 months ago

mephillips-durham commented 10 months ago

In the section for Easy or Hard: After creating your new application I was able to start Solr using solr_wrapper. I was able to access the Solr web interface. I then tried the "Index some data" step and got this error:

vagrant@ubuntu-jammy:~$ cd projects/search_app/
vagrant@ubuntu-jammy:~/projects/search_app$ rake solr:marc:index_test_data
rake aborted!
LoadError: cannot load such file -- /home/vagrant/projects/search_app/app/models/marc_indexer
<internal:/home/vagrant/.asdf/installs/ruby/3.2.2/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
<internal:/home/vagrant/.asdf/installs/ruby/3.2.2/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
Tasks: TOP => solr:marc:index:work
(See full trace by running task with --trace)

The /home/vagrant/projects/search_app/app/models/marc_indexer file does not seem to be present. Searching using find from the home directory I can see these are present:

vagrant@ubuntu-jammy:~$ find . | grep marc_indexer
./.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/traject-3.8.1/lib/traject/indexer/marc_indexer.rb
./.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/blacklight-marc-8.1.0/lib/generators/blacklight/marc/templates/app/models/marc_indexer.rb

Is there a fault with the rake task for index_test_data or should I be located in a different directory to run the command, perhaps?

I followed the Creating a new application the easy way. I see the "hard way" instructions include rails generate blacklight:install --devise --marc --solr_version=latest to generate blacklight-marc into the application, so perhaps that is missing from the easy method? I checked here and there seems to be something about including blacklight-marc in the easy method. (Though I don't fully understand the ENV.fetch and whether it will take the --devise and --marc options or not.)

bess commented 4 months ago

I can confirm this bug on a mac, newly generated blacklight application, using lando for solr:

be rake solr:marc:index_test_data
rake aborted!
ArgumentError: Traject::SolrJsonWriter: Neither solr.update_url nor solr.url set; need at least one (ArgumentError)

      raise ArgumentError.new("#{self.class.name}: Neither solr.update_url nor solr.url set; need at least one")
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/Users/bess/.asdf/installs/ruby/3.2.0/bin/bundle:25:in `load'
/Users/bess/.asdf/installs/ruby/3.2.0/bin/bundle:25:in `<main>'
Tasks: TOP => solr:marc:index:work
(See full trace by running task with --trace)

I will see if I can figure it out.