[英]Does not have storage.buckets.list access to the Google Cloud project?
I wrote a Ruby script that will upload an audio file to a Google Cloud Storage.我写了一个 Ruby 脚本,它将音频文件上传到谷歌云存储。
def upload_to_Google_cloud(audio_file)
project_id = "<project_id>"
key_file = "<json_file>"
storage = Google::Cloud::Storage.new project: project_id, keyfile: key_file
bucket_name = storage.buckets.first.name
puts bucket_name
bucket = storage.bucket bucket_name
local_file_path = "/path/#{audio_file}"
file = bucket.create_file local_file_path, "#{audio_file}.flac"
return "Uploaded #{file.name}"
end
Though, everytime I run the command -> ruby video_dictation.rb, it returns me an error which is xxxxxxxxx does not have storage.buckets.list access to the Google Cloud project.虽然,每次我运行命令 -> ruby video_dictation.rb 时,它都会返回一个错误,即xxxxxxxxx 没有 storage.buckets.list 访问 Google Cloud 项目的权限。 (Google::Cloud::PermissionDeniedError) .
(谷歌::云::PermissionDeniedError) 。
Any help, suggestions?任何帮助,建议? Thanks!
谢谢!
Should be permission issue.应该是权限问题。
5. Remember to download the json key file for that particular service account. 5. 请记住下载该特定服务帐户的 json 密钥文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.