require 'thrift'

$:.push('lib/thrift/gen-rb')
require 'recommender'

class HomeController < ApplicationController
  def index
    transport = Thrift::FramedTransport.new(Thrift::Socket.new('localhost', 9090))
    protocol = Thrift::BinaryProtocol.new(transport)
    client = Recommender::Client.new(protocol)

    transport.open()

    @answer = client.ping()
  end
end

require 'thrift'

$:.push('lib/thrift/gen-rb')
require 'recommender'

class HomeController < ApplicationController
  def index
    transport = Thrift::FramedTransport.new(Thrift::Socket.new('127.0.0.1', 9090))
    protocol = Thrift::BinaryProtocol.new(transport)
    client = Recommender::Client.new(protocol)

    transport.open()

    @answer = client.ping()
  end
end

Use 127.0.0.1 instead of localhost to appease Mac OS
Use 127.0.0.1 instead of localhost to appease Mac OS

For some unknown reason, this works perfectly with 127.0.0.1 but doesn't
work with localhost. Eh?
