aboutsummaryrefslogtreecommitdiffstats
path: root/vendor
diff options
context:
space:
mode:
Diffstat (limited to 'vendor')
-rw-r--r--vendor/plugins/acts_as_solr/config/environment.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/vendor/plugins/acts_as_solr/config/environment.rb b/vendor/plugins/acts_as_solr/config/environment.rb
index 3450bfe83..851b59788 100644
--- a/vendor/plugins/acts_as_solr/config/environment.rb
+++ b/vendor/plugins/acts_as_solr/config/environment.rb
@@ -4,7 +4,9 @@ SOLR_PATH = "#{File.dirname(File.expand_path(__FILE__))}/../solr" unless defined
# XXX hacky stuff to read the port from the main config file
RAILS_SOLR_CONFIG="#{SOLR_PATH}/../../../../config/solr.yml"
rails_solr_config = YAML.load(File.read(RAILS_SOLR_CONFIG))
-rails_solr_url = rails_solr_config[ENV['RAILS_ENV']]['url']
+rails_solr_config_read = rails_solr_config[ENV['RAILS_ENV']]
+raise "no config in solr.yml for " + ENV['RAILS_ENV'] if rails_solr_config_read.nil?
+rails_solr_url = rails_solr_config_read['url']
rails_solr_port = rails_solr_url.match(/http:\/\/localhost:(\d+)\/solr/)[1]
SOLR_PORT = rails_solr_port.to_i