On Wed, Oct 14, 2015 at 04:51:47PM -0400, Paul Hoffman wrote:
> On Wed, Oct 14, 2015 at 12:37:43PM -0400, Benjamin Armintor wrote:
> > When you interrupt there, you would need to make sure the rest of template
> > commands are executed as well:
> >
> >
https://raw.githubusercontent.com/projectblacklight/blacklight/master/template.demo.rb
>
> Thanks -- I wouldn't have realized that. I'm stumped as to *how* to
> execute them, however; my naive attempts yield the error message below.
> Do I have to run the commands using rake, or using ruby itself? Or in
> some other way?
I decided to start over, this time using sudo and actually *thinking*
about the output of the rails command -- it shows me which steps are
failing because of the invalid platform code. I made it much further in
the quickstart guide, but when attempting to index the sample MARC
recors I hit a "SolrCore Initialization Failures" warning that says "No
cores available". Is Solr perhaps not actually running?
Here's what I did this time, for posterity and in case it illuminates
the underlying cause of the problem...
------------------------------------------------------------------------
$ cd ~/projects
$ sudo -v
apply
https://raw.github.com/projectblacklight/blacklight/master/template.demo.rb
gemfile blacklight (>= 5.3.0)
gemfile jettywrapper (>= 2.0)
gemfile tzinfo-data
run bundle install from "."
Resolving dependencies...............................................................................................
Using rake 10.4.2
[snip]
Using uglifier 2.7.2
Bundle complete! 12 Gemfile dependencies, 56 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
generate blacklight:install
`x64_mingw` is not a valid platform. The available options are: [:ruby, :ruby_18, :ruby_19, :ruby_20, :mri, :mri_18, :mri_19, :mri_20, :rbx, :jruby, :mswin, :mingw, :mingw_18, :mingw_19, :mingw_20]
rake db:migrate
`x64_mingw` is not a valid platform. The available options are: [:ruby, :ruby_18, :ruby_19, :ruby_20, :mri, :mri_18, :mri_19, :mri_20, :rbx, :jruby, :mswin, :mingw, :mingw_18, :mingw_19, :mingw_20]
rake jetty:clean
`x64_mingw` is not a valid platform. The available options are: [:ruby, :ruby_18, :ruby_19, :ruby_20, :mri, :mri_18, :mri_19, :mri_20, :rbx, :jruby, :mswin, :mingw, :mingw_18, :mingw_19, :mingw_20]
rake jetty:start
`x64_mingw` is not a valid platform. The available options are: [:ruby, :ruby_18, :ruby_19, :ruby_20, :mri, :mri_18, :mri_19, :mri_20, :rbx, :jruby, :mswin, :mingw, :mingw_18, :mingw_19, :mingw_20]
rake blacklight:index:seed
`x64_mingw` is not a valid platform. The available options are: [:ruby, :ruby_18, :ruby_19, :ruby_20, :mri, :mri_18, :mri_19, :mri_20, :rbx, :jruby, :mswin, :mingw, :mingw_18, :mingw_19, :mingw_20]
rake jetty:stop
`x64_mingw` is not a valid platform. The available options are: [:ruby, :ruby_18, :ruby_19, :ruby_20, :mri, :mri_18, :mri_19, :mri_20, :rbx, :jruby, :mswin, :mingw, :mingw_18, :mingw_19, :mingw_20]
run bundle install
`x64_mingw` is not a valid platform. The available options are: [:ruby, :ruby_18, :ruby_19, :ruby_20, :mri, :mri_18, :mri_19, :mri_20, :rbx, :jruby, :mswin, :mingw, :mingw_18, :mingw_19, :mingw_20]
$ cd search_app
$ vim Gemfile
[remove the tzinfo-data gem]
$ sudo -v
$ bundle install
Bundle complete! 11 Gemfile dependencies, 56 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
$ rails generate blacklight:install --devise --marc --jettywrapper
/var/lib/gems/1.9.1/gems/execjs-2.6.0/lib/execjs/runtimes.rb:48:in `autodetect': Could not find a JavaScript runtime. See
https://github.com/rails/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
$ echo 'gem "therubyracer"' >> Gemfile
$ rails generate blacklight:install --devise --marc --jettywrapper
gemfile jettywrapper (>= 2.0)
create config/jetty.yml
append Rakefile
gemfile rsolr (~> 1.0.6)
run bundle install from "."
Resolving dependencies...
Using rake 10.4.2
[snip]
Using uglifier 2.7.2
Bundle complete! 13 Gemfile dependencies, 59 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
generate blacklight:assets
create app/assets/stylesheets/blacklight.css.scss
insert app/assets/javascripts/application.js
generate blacklight:document
create app/models/solr_document.rb
generate blacklight:search_builder
create app/models/search_builder.rb
generate blacklight:models
create config/blacklight.yml
rake blacklight:install:migrations
Copied migration 20151015201029_create_searches.blacklight.rb from blacklight
Copied migration 20151015201030_create_bookmarks.blacklight.rb from blacklight
Copied migration 20151015201031_add_polymorphic_type_to_bookmarks.blacklight.rb from blacklight
generate blacklight:user
gemfile devise
gemfile devise-guests (~> 0.3)
run bundle install from "."
Resolving dependencies...
Using rake 10.4.2
[snip]
Using uglifier 2.7.2
Bundle complete! 15 Gemfile dependencies, 65 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
generate devise:install
create config/initializers/devise.rb
create config/locales/devise.en.yml
===============================================================================
Some setup you must do manually if you haven't yet:
[snip -- see below]
===============================================================================
generate devise
invoke active_record
create db/migrate/20151015201051_devise_create_users.rb
create app/models/user.rb
invoke test_unit
create test/models/user_test.rb
create test/fixtures/users.yml
insert app/models/user.rb
route devise_for :users
generate devise_guests
invoke active_record
create db/migrate/20151015201059_add_devise_guests_to_users.rb
insert app/models/user.rb
gsub config/initializers/devise.rb
insert app/models/user.rb
generate blacklight:controller
insert app/controllers/application_controller.rb
create app/controllers/catalog_controller.rb
route blacklight_for :catalog
route root to: "catalog#index"
insert config/application.rb
create config/locales/blacklight.en.yml
create config/initializers/blacklight_initializer.rb
gemfile blacklight-marc (~> 5.0)
run bundle install from "."
Resolving dependencies...
Using rake 10.4.2
[snip]
Using uglifier 2.7.2
Bundle complete! 16 Gemfile dependencies, 70 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
generate blacklight:marc:install
create config/SolrMarc
create config/SolrMarc/config-test.properties
create config/SolrMarc/config.properties
create config/SolrMarc/index.properties
create config/SolrMarc/index_scripts/dewey.bsh
create config/SolrMarc/index_scripts/format.bsh
create config/SolrMarc/translation_maps/README_MAPS
create config/SolrMarc/translation_maps/callnumber_map.properties
create config/SolrMarc/translation_maps/composition_era_map.properties
create config/SolrMarc/translation_maps/country_map.properties
create config/SolrMarc/translation_maps/format_map.properties
create config/SolrMarc/translation_maps/instrument_map.properties
create config/SolrMarc/translation_maps/language_map.properties
insert app/models/solr_document.rb
insert app/controllers/catalog_controller.rb
route Blacklight::Marc.add_routes(self)
$ rake db:migrate
[snip -- looks good]
$ rake jetty:clean
I, [2015-10-15T16:15:47.379304 #17157] INFO -- : Downloading jetty at
https://github.com/projectblacklight/blacklight-jetty/archive/v4.10.3.zip ...
I, [2015-10-15T16:16:22.418087 #17157] INFO -- : Unpacking tmp/v4.10.3.zip...
------------------------------------------------------------------------
So far, so good. The manual setup instructions that I snipped above are
pretty clear so I do those now, then continue with step 6 (i.e., the
beginning of the `Easy or Hard: After creating your new application'
section):
------------------------------------------------------------------------
$ vim config/environments/development.rb
[insert:]
config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
$ vim config/routes.rb
[notice that _root to:_ is already set, so leave it untouched]
$ vim app/views/layouts/application.html.erb
[insert:]
<p class="notice"><%= notice %></p>
<p class="alert"><%= alert %></p>
$ rake jetty:start
D, [2015-10-15T16:40:08.056673 #17260] DEBUG -- : Starting jetty with these values:
D, [2015-10-15T16:40:08.056846 #17260] DEBUG -- : jetty_home: /home/paul/projects/search_app/jetty
D, [2015-10-15T16:40:08.056953 #17260] DEBUG -- : jetty_command: java -Djetty.port=8983 -Dsolr.solr.home=/home/paul/projects/search_app/jetty/solr -jar start.jar
W, [2015-10-15T16:40:08.058012 #17260] WARN -- : Logging jettywrapper stdout to /home/paul/projects/search_app/jetty/jettywrapper.log
D, [2015-10-15T16:40:08.066449 #17260] DEBUG -- : Wrote pid file to /home/paul/projects/search_app/tmp/pids/_home_paul_projects_search_app_jetty_development.pid with value 17265
I, [2015-10-15T16:40:16.133549 #17260] INFO -- : Started jetty (8075.0ms)
jetty started at PID 17265
------------------------------------------------------------------------
All looks good, so I try importing the test MARC records (step 7):
------------------------------------------------------------------------
$ rake solr:marc:index_test_data
java -Xmx512m -Dsolr.hosturl=
http://127.0.0.1:8983/solr/blacklight-core -jar /var/lib/gems/1.9.1/gems/blacklight-marc-5.10.0/lib/SolrMarc.jar /home/paul/projects/search_app/config/SolrMarc/config.properties /var/lib/gems/1.9.1/gems/blacklight-marc-5.10.0/test_support/data/test_data.utf8.mrc
log4j:ERROR setFile(null,true) call failed.
java.io.FileNotFoundException: /var/lib/gems/1.9.1/gems/blacklight-marc-5.10.0/lib/solrmarc.log (Permission denied)
[snip]
------------------------------------------------------------------------
OK, so I'll run it as root and sort out the ownership/permission details
later:
------------------------------------------------------------------------
$ sudo rake solr:marc:index_test_data
java -Xmx512m -Dsolr.hosturl=
http://127.0.0.1:8983/solr/blacklight-core -jar /var/lib/gems/1.9.1/gems/blacklight-marc-5.10.0/lib/SolrMarc.jar /home/paul/projects/search_app/config/SolrMarc/config.properties /var/lib/gems/1.9.1/gems/blacklight-marc-5.10.0/test_support/data/test_data.utf8.mrc
INFO [main] (MarcImporter.java:816) - Starting SolrMarc indexing.
INFO [main] (Utils.java:191) - Opening file: /home/paul/projects/search_app/config/SolrMarc/config.properties
[snip]
------------------------------------------------------------------------
When I use w3m to access that URL I get an error message:
| Apache SOLR
|
| SolrCore Initialization Failures
|
| Please check your logs for more information
| [snip]
| No cores available Go and create one
| [snip]
| Connection lost …
So I gather that Solr is not running? My jetty-wrapper log doesn't show
any errors, nor does my solr.log:
------------------------------------------------------------------------
$ fgrep -c -i err $(find . -name \*.log)
./log/development.log:0
./jetty/jettywrapper.log:0
./jetty/logs/solr.log:0
------------------------------------------------------------------------
Any ideas what I need to do at this point?
Thanks in advance,