Skip to content

Adding blacklight_advanced_search to Gemfile before installing blacklight ends badly. #1

Closed
cbeer opened this Issue Jan 17, 2012 · 1 comment

2 participants

@cbeer
Project Blacklight member
cbeer commented Jan 17, 2012

If you create a new rails application and add both blacklight and blacklight_advanced_search to the Gemfile, when you go to generate blacklight, you get an error from blacklight_advanced_search when it tries to initialize:

md-20015348:blacklight_test chris_beer$ rails generate blacklight
/Users/chris_beer/.rvm/gems/ruby-1.9.3-p0@blacklight-test/gems/blacklight_advanced_search-1.1.2/lib/blacklight_advanced_search.rb:46:in `config_defaults': You have a nil object when you didn't expect it! (NoMethodError)
You might have expected an instance of Array.
The error occurred while evaluating nil.find_all
    from /Users/chris_beer/.rvm/gems/ruby-1.9.3-p0@blacklight-test/gems/blacklight_advanced_search-1.1.2/lib/blacklight_advanced_search.rb:18:in `init'
    from /Users/chris_beer/.rvm/gems/ruby-1.9.3-p0@blacklight-test/gems/blacklight_advanced_search-1.1.2/lib/blacklight_advanced_search/engine.rb:11:in `block in <class:Engine>'
    from /Users/chris_beer/.rvm/gems/ruby-1.9.3-p0@blacklight-test/gems/activesupport-3.1.3/lib/active_support/lazy_load_hooks.rb:34:in `call'
    from /Users/chris_beer/.rvm/gems/ruby-1.9.3-p0@blacklight-test/gems/activesupport-3.1.3/lib/active_support/lazy_load_hooks.rb:34:in `execute_hook'
    from /Users/chris_beer/.rvm/gems/ruby-1.9.3-p0@blacklight-test/gems/activesupport-3.1.3/lib/active_support/lazy_load_hooks.rb:43:in `block in run_load_hooks'
    from /Users/chris_beer/.rvm/gems/ruby-1.9.3-p0@blacklight-test/gems/activesupport-3.1.3/lib/active_support/lazy_load_hooks.rb:42:in `each'
    from /Users/chris_beer/.rvm/gems/ruby-1.9.3-p0@blacklight-test/gems/activesupport-3.1.3/lib/active_support/lazy_load_hooks.rb:42:in `run_load_hooks'
    from /Users/chris_beer/.rvm/gems/ruby-1.9.3-p0@blacklight-test/gems/railties-3.1.3/lib/rails/application/finisher.rb:56:in `block in <module:Finisher>'
    from /Users/chris_beer/.rvm/gems/ruby-1.9.3-p0@blacklight-test/gems/railties-3.1.3/lib/rails/initializable.rb:30:in `instance_exec'
    from /Users/chris_beer/.rvm/gems/ruby-1.9.3-p0@blacklight-test/gems/railties-3.1.3/lib/rails/initializable.rb:30:in `run'
    from /Users/chris_beer/.rvm/gems/ruby-1.9.3-p0@blacklight-test/gems/railties-3.1.3/lib/rails/initializable.rb:55:in `block in run_initializers'
    from /Users/chris_beer/.rvm/gems/ruby-1.9.3-p0@blacklight-test/gems/railties-3.1.3/lib/rails/initializable.rb:54:in `each'
    from /Users/chris_beer/.rvm/gems/ruby-1.9.3-p0@blacklight-test/gems/railties-3.1.3/lib/rails/initializable.rb:54:in `run_initializers'
    from /Users/chris_beer/.rvm/gems/ruby-1.9.3-p0@blacklight-test/gems/railties-3.1.3/lib/rails/application.rb:96:in `initialize!'
    from /Users/chris_beer/.rvm/gems/ruby-1.9.3-p0@blacklight-test/gems/railties-3.1.3/lib/rails/railtie/configurable.rb:30:in `method_missing'
    from /Volumes/Scratch/blacklight_test/config/environment.rb:5:in `<top (required)>'
    from /Users/chris_beer/.rvm/gems/ruby-1.9.3-p0@blacklight-test/gems/railties-3.1.3/lib/rails/application.rb:83:in `require'
    from /Users/chris_beer/.rvm/gems/ruby-1.9.3-p0@blacklight-test/gems/railties-3.1.3/lib/rails/application.rb:83:in `require_environment!'
    from /Users/chris_beer/.rvm/gems/ruby-1.9.3-p0@blacklight-test/gems/railties-3.1.3/lib/rails/commands.rb:22:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'
@jrochkind
Project Blacklight member

Can not reproduce.

I create a new Rails app with rails new testapp, I add gem "blacklight" and gem 'blacklight_advanced_search' to Gemfile.

I run rails generate blacklight. It seems to work fine. (It does politely warn about not finding a user.rb to customize, as expected from this particular repro script).

It ended up with blacklight 4.6.2 and blacklight_advanced_search 2.1.1 -- not entirely sure why it didn't choose the latest blacklight 4.x, 4.7.0, but that's a different issue that will be resolved in attempt to make a final relase for BL 4.7.

If you feel like investigating to see if you can still reproduce, and can, then let me know exact repro script and versions of blacklight/advanced_search. Otherwise will just close.

@jrochkind jrochkind closed this Feb 18, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.