【发布时间】:2013-05-20 13:47:10
【问题描述】:
我有一个在'http://localhost:4567/order_summary' 上运行的服务,所以当我转到那个地址时,它会向我显示它的 JSON 表示,这正是我想要的。
现在在另一个 Rail 应用程序中,我创建了一个如此简单的控制器,以开始调用该服务并使用其 JSON:
class PharmacyController < ApplicationController
def index
result = Typhoeus::Request::get('http://localhost:4567/order_summary')
@code = result.code
end
end
但是当我转到http://localhost:3000/pharmacy/ 地址时,我得到了
NameError in PharmacyController#index
uninitialized constant PharmacyController::Typhoeus
我应该根据那个错误来初始化它是什么?
【问题讨论】:
标签: ruby-on-rails-3.2 typhoeus