ruby on rails - Bonsai-Elasticsearch crashing in Heroku Production URI::InvalidURIError -


i've gotten elasticsearch not crash app on startup anytime try search app crashes , adding new record crashes app (but record added).

the error message is:

 professor store (0.9ms)  {"id":59,"exception":["uri::invalidurierror","bad uri(is not uri?): http://heroku config:0"]} 2016-09-12t16:48:34.008480+00:00 app[web.1]: completed 500 internal server error in 14ms (searchkick: 0.9ms | activerecord: 7.6ms | elasticsearch: 0.0ms) 2016-09-12t16:48:34.009289+00:00 app[web.1]:  2016-09-12t16:48:34.009290+00:00 app[web.1]: uri::invalidurierror (bad uri(is not uri?): http://heroku config:0): 2016-09-12t16:48:34.009291+00:00 app[web.1]:   app/controllers/professors_controller.rb:51:in `block in create' 2016-09-12t16:48:34.009291+00:00 app[web.1]:   app/controllers/professors_controller.rb:50:in `create' 

i'm not sure what's uri::invalidurierror (bad uri(is not uri?): http://heroku config:0): i've gone through here, , i've looked @ on uri error , app still crashing same reason.

my bonsai.rb looks like: `bonsai_url = env['beech-6556653.us-east-1.bonsai.io']

if bonsai_url   uri = uri.parse(env['beech-6556653.us-east-1.bonsai.io']) searchkick.client = elasticsearch::client.new({   url:bonsai_url,   log: true   }) end 

my professor.rb model has searchkick:

class professor < activerecord::base   searchkick   belongs_to :user   has_many :reviews 

lastly gemfile:

 source 'https://rubygems.org' ruby '2.3.1'     # bundle edge rails instead: gem 'rails', github: 'rails/rails'     gem 'rails', '4.2.5.1'     # use scss stylesheets     gem 'sass-rails', '~> 5.0'     # use uglifier compressor javascript assets     gem 'uglifier', '>= 1.3.0'     # use coffeescript .coffee assets , views     gem 'coffee-rails', '~> 4.1.0'     #bcrypt for encrpytion     gem 'bcrypt', '~> 3.1', '>= 3.1.11'     #byebug     gem 'byebug', '~> 9.0', '>= 9.0.5'     # use jquery javascript library     gem 'jquery-rails'     # turbolinks makes following links in web application faster. read more: https://github.com/rails/turbolinks     gem 'turbolinks'     # build json apis ease. read more: https://github.com/rails/jbuilder     gem 'jbuilder', '~> 2.0'     # bundle exec rake doc:rails generates api under doc/api.     gem 'sdoc', '~> 0.4.0', group: :doc     #paperclip easy upload management     gem 'paperclip', '~> 4.3', '>= 4.3.6'     #bootstrap-sass     gem 'bootstrap-sass', '~> 3.3', '>= 3.3.6'     #searchkick     gem 'searchkick', '~> 1.2', '>= 1.2.1'     #paginate     gem 'will_paginate', '~> 3.1'     #paginate bootstrap     gem 'bootstrap-will_paginate', '~> 0.0.10'     #rmagick     gem 'rmagick', '~> 2.15', '>= 2.15.4'     #carrierwave     gem 'carrierwave'     #cloudinary     gem 'cloudinary'     #paperclip forcloudinary     gem 'paperclip-cloudinary' 

this line unnecessary:

uri = uri.parse(env['beech-6556653.us-east-1.bonsai.io'])

especially because env isn't assigned value. can see of app's environment variables heroku config:get in terminal.


Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -