Google vision is throwing me the following error on ruby on rails which had me baffled.
Unable to convert "image_path" to an Image
However, I am able to display each image form it's respective path if I use the image_tag method for rails. Please advise as I am new to this, thank you.
<% @uploads.each do |u| %>
<% require "google/cloud/vision"
vision = Google::Cloud::Vision.new(
project: "first-ocr-project",
keyfile: JSON.parse(ENV['GOOGLECLOUD_API_KEY'])
)
#Error Unable to convert "image_path" to an Image
raw_data = vision.image(u.photos[0])
%>
#Able to displays all photos from path
<%= image_tag u.photos[0] %></br>
<% end %>