I had to rewrite the code in Article I wrote before, so I tried to deal with it.
Be careful if you update gem google-cloud-vision
from v0.x series to v1.0.0.
fundamentally
Migrating to google-cloud-vision 1.0 https://github.com/googleapis/google-cloud-ruby/blob/master/google-cloud-vision/MIGRATING.md
As it is written in, about #safe_search_detection
[here](https://googleapis.dev/ruby/google-cloud-vision-v1/latest/Google/Cloud/Vision/V1/ImageAnnotator/Client. html # safe_search_detection-instance_method) was easier to understand.
require "google/cloud/vision"
image_annotator = Google::Cloud::Vision::ImageAnnotator.new
To
require "google/cloud/vision/v1"
image_annotator = Google::Cloud::Vision::V1::ImageAnnotator::Client.new
Rewritten to.
It seems that Google Cloud Vision had a destructive version upgrade before ...
Recommended Posts