Ruby on rails Money::Bank::GoogleCurrencyFetchError
当我使用exchange\u to:CLP.to\I方法时,它在OrdersControllercreate中给出了错误Money::Bank::GoogleCurrencyFetchError Money::Bank::GoogleCurrencyFetchErrorRuby on rails Money::Bank::GoogleCurrencyFetchError,ruby-on-rails,ruby,Ruby On Rails,Ruby,当我使用exchange\u to:CLP.to\I方法时,它在OrdersControllercreate中给出了错误Money::Bank::GoogleCurrencyFetchError Money::Bank::GoogleCurrencyFetchError # class OrdersController < ApplicationController def create @buying_methods = Order.buying_methods.keys
# class OrdersController < ApplicationController
def create
@buying_methods = Order.buying_methods.keys
@shipping_type_clients = Order.shipping_type_clients.keys
@order = Order.new(order_params)
@order.dollar = Money.new(100, "USD").exchange_to(:CLP).to_i
@order.user = current_user
respond_to do |format|
if @order.save
if @order.cmm_buy?
@order.in_draft!
end
format.html { redirect_to "#{my_account_path}#my-orders", notice: 'El pedido se ha creado con éxito.' }
else
@order.products.build
format.html { render :new }
end
end
end
# config/initializers/google_currency.rb
require 'money'
require 'money/bank/google_currency'
# seconds after than the current rates are automatically expired (24 hours)
Money::Bank::GoogleCurrency.ttl_in_seconds = 86400
# set default bank to instance of GoogleCurrency
Money.default_bank = Money::Bank::GoogleCurrency.new
# config/initializers/
MoneyRails.configure do |config|
config.register_currency = {
:iso_code => "US8",
:subunit_to_unit => 100_000_000,
:thousands_separator => ".",
:decimal_mark => ","
}
end
不幸的是,我们有同样的问题。。等待答复
看来有一种谷歌货币可以解决这个问题。不幸的是,我们也遇到了同样的问题。。等待答复 似乎有一种谷歌货币可以解决这个问题。在您的文件中: config/initializer/money.rb 在顶部添加此行:
Money::Bank::GoogleCurrency::SERVICE_HOST="finance.google.com"
在您的文件中:
config/initializer/money.rb
在顶部添加此行:
Money::Bank::GoogleCurrency::SERVICE_HOST="finance.google.com"
GoogleCurrency今天有问题GoogleCurrency今天有问题这是一个快速解决方案,但升级到3.4.0会解决问题这是一个快速解决方案,但升级到3.4.0会解决问题升级gem a 3.4.0升级gem a 3.4.0