Ruby on rails 如何使用Rails应用程序从Bigcommerce检索数据?
我正在尝试将Rails应用程序与BigCommerceAPI连接起来,但我不能,也不知道为什么 我接着说: 将“gem bigcommerce”添加到我的gem文件 执行“bundle安装” 将代码放在ApplicationController索引中Ruby on rails 如何使用Rails应用程序从Bigcommerce检索数据?,ruby-on-rails,ruby-on-rails-3,ruby-on-rails-4,integration,bigcommerce,Ruby On Rails,Ruby On Rails 3,Ruby On Rails 4,Integration,Bigcommerce,我正在尝试将Rails应用程序与BigCommerceAPI连接起来,但我不能,也不知道为什么 我接着说: 将“gem bigcommerce”添加到我的gem文件 执行“bundle安装” 将代码放在ApplicationController索引中 def index api = Bigcommerce::Api.new({ :store_url => "http://mystore.mybigcommerce.com",
def index
api = Bigcommerce::Api.new({
:store_url => "http://mystore.mybigcommerce.com",
:username => "user",
:api_key => "3a0ce...[my api key]"
})
puts api.time
结束
停止并启动Rails服务器
我收到一个错误,上面写着“未定义的方法'time'for”
有没有人能告诉我我做错了什么,以及如何在Rails应用程序中配置Bigcommerce?我找到了那个官员,但我不太清楚
提前感谢您是否在ApplicationController文件中添加了require
require 'bigcommerce'
是的,我在ApplicationController文件中添加了这一行,但是错误仍然存在,请同时删除print api.methods;