简体   繁体   中英

how to get work sunspot rails with heroku

Hi i am using sunspot_rails gem for searching.It is working fine on my local machine but there is problems with configuring it with heroku.And i have this error

           Errno::ECONNREFUSED (Connection refused - connect(2)):

this is my sunspot.yml settings

  production:
    solr:
      hostname: index.websolr.com
      port: 8983
      log_level: WARNING

  development:
    solr:
      hostname: localhost
      port: 8982
      log_level: INFO

while i am starting sunspot solar with this command

     heroku run rake sunspot:solr:start

Please help..

Thanks

The command you're trying to use fire a solr server, but you're using websolr as you stated in your configuration.

You don't need to run that command except in local, where you don't rely on websolr.

According to the documentation, sunspot_rails handles WEBSOLR_URL you could check with "heroku config" if that environment variable is correctly set by the addon.

Moreover, https://github.com/outoftime/sunspot/blob/master/sunspot_rails/lib/sunspot/rails/configuration.rb#L312 tells us that if you do not give any url or host in the yml under the production key it will fallback to that environement variable. So you may just need to wipe the hostname and port from there and it should work as intended.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM