【发布时间】:2018-06-17 10:40:29
【问题描述】:
我正在使用两个 API:Cloudinary 和 Google Maps Geocoding API,它们都可以毫无问题地进行开发。 但是在 prod 上,Google Maps 不起作用,因为“Google Maps API 警告:NoApiKeys”。
heroku config:set GOOGLE_API_SERVER_KEY=AIza*****************************4
工作正常,我在 heroku 的仪表板上找到了我的两个 API 密钥,但是:
figaro heroku:set -e production
Could not find command "heroku:set"
同理:
figaro heroku:set
Could not find command "heroku:set"
我想我的问题在于 gem figaro。 我的宝石文件:
#figaro
gem 'figaro', '~> 1.1', '>= 1.1.1'
Application.yml
# Add configuration values here, as shown below.
#
# pusher_app_id: "2954"
# pusher_key: 7381a978f7dd7f9a1117
# pusher_secret: abdc3b896a0ffb85d373
# stripe_api_key: sk_test_2J0l093xOyW72XUYJHE4Dv2r
# stripe_publishable_key: pk_test_ro9jV5SNwGb1yYlQfzG17LHK
#
# production:
# stripe_api_key: sk_live_EeHnL644i6zo4Iyq4v1KdV9H
# stripe_publishable_key: pk_live_9lcthxpSIHbGwmdO941O1XVU
CLOUDINARY_URL: "cloudinary://6714********************************t"
GOOGLE_API_SERVER_KEY: "AIz***********************************4"
当我输入时:
bundle exec figaro heroku:set
我什么都好(我猜):
Setting CLOUDINARY_URL, GOOGLE_API_SERVER_KEY and restarting ⬢ coin-de-paris... done, v27
CLOUDINARY_URL: cloudinary://671**********************st
GOOGLE_API_SERVER_KEY: AI**********************4
我是开发世界的新手,如果答案很简单,我很抱歉 :) 感谢您的宝贵时间!
编辑: 我尝试了几个版本的 figaro,例如:
gem 'figaro', '~> 1.1', '>= 1.1.1'
gem 'figaro', github: 'sealocal/figaro'
gem 'figaro', '>= 1.0.0.rc1'
gem 'figaro'
然后:
bundle install
bundle binstubs figaro
figaro install
spring stop
但是当我跑步时:
figaro heroku:set -e production
和
figaro heroku:set
我有:
Could not find command "heroku:set".
版本:
ruby '2.3.5'
gem 'rails', '~> 5.1.4'
【问题讨论】:
-
您使用哪个版本的 ruby、rails 和 figaro ?
-
Gemfile : ruby '2.3.5' gem 'figaro', '~> 1.1', '>= 1.1.1' gem 'rails', '~> 5.1.4'
-
你能试试这个 gem 'figaro', github: 'sealocal/figaro' 吗?
-
@sam 我试过了,还是不行
-
figaro heroku:set -e production 试试这个
标签: ruby-on-rails google-maps heroku rails-geocoder figaro-ruby