I'm having difficulty with connecting my Heroku app to an Elasticsearch instance. I'm using the tire gem and the bonsai add-on on Heroku.
When I deploy the application I get this error twice:
Skipping index creation, cannot connect to Elasticsearch
I also have this in my initialize bonsai.rb file:
if ENV['BONSAI_INDEX_URL']
bonsai_uri = URI.parse(ENV['BONSAI_INDEX_URL'])
Tire.configure do
url "http://sampleindex.bonsai.io"
end
BONSAI_INDEX_NAME = bonsai_uri.path[1..-1]
else
BONSAI_INDEX_NAME = "my_index"
end
Looking like you may be pointing to an invalid ElasticSearch URL. Try typing the following from the command line:
This should return the operating URL on Heroku's Bonsai service. Use this in your configuration: