我正在使用狂欢购物车,我想要多种货币支持,所以我在我的宝石文件中使用下面的宝石
gem "spree_multi_currency", :git => "git://github.com/pronix/spree-multi-currency.git"
而不是捆绑安装
rake spree_multi_currency:install:migrations
rake db:migrate
然后使用以下代码加载货币
rake spree_multi_currency:currency:iso4217
现在我想从谷歌加载费率并将美元作为默认货币 因为我在终端上输入
rake spree_multi_currency:rates:google[USD]
但它会出现错误,如
Loads currency data from Google using #<Spree::Currency:0xb967020>
http://www.google.com/ig/calculator?hl=en&q=1INR%3D%3FEUR
耙子流产了!
757:意外的令牌
/home/tps/.rvm/gems/ruby-2.0.0-p247/gems/json-1.8.1/lib/json/common.rb:155:in parse'
/home/tps/.rvm/gems/ruby-2.0.0-p247/gems/json-1.8.1/lib/json/common.rb:155:in
解析'
/home/tps/.rvm/gems/ruby-2.0.0-p247/bundler/gems/spree-multi-currency-0abaa72ab8ed/lib/tasks/spree_multi_currency.rake:126:in block (4 levels) in <top (required)>'
/home/tps/.rvm/gems/ruby-2.0.0-p247/gems/activerecord-4.0.2/lib/active_record/relation/delegation.rb:13:in
each'
/home/tps/.rvm/gems/ruby-2.0.0-p247/gems/activerecord-4.0.2/lib/active_record/relation/delegation.rb:13:in each'
/home/tps/.rvm/gems/ruby-2.0.0-p247/bundler/gems/spree-multi-currency-0abaa72ab8ed/lib/tasks/spree_multi_currency.rake:122:in
块(3级)in “
/home/tps/.rvm/gems/ruby-2.0.0-p247/bin/ruby_executable_hooks:15:in eval'
/home/tps/.rvm/gems/ruby-2.0.0-p247/bin/ruby_executable_hooks:15:in
'
任务:TOP =&gt; spree_multi_currency:价格:谷歌
(通过使用--trace运行任务查看完整跟踪)
我希望我的购物车支持多种货币支持。
提前致谢
答案 0 :(得分:1)
从管理端添加货币汇率。例如,美元基本货币比转换器中选择货币(INR),设置名义利率意味着1美元= 63 INR,而不是名义上的63作为名义货币,1作为价值。