Q:

Obtaining a render Argument Error: What is the correct syntax or usage? 

I am new to Ruby, Sinatra and Pusher so this is a basic question.  I am attempting to authenticate a Pusher Client (using iOS demo code https://github.com/lukeredpath/libPusher).  The server code below fails with error when the iOS client attempts to join a presence channel:
ArgumentError - wrong number of arguments (1 for 2):
    /Users/waveocean/.rvm/gems/ruby-1.9.3-p327/gems/sinatra-1.3.3/lib/sinatra/base.rb:665:in `render'
    web.rb:13:in `auth'
    web.rb:26:in `block in <main>'
    /Users/waveocean/.rvm/gems/ruby-1.9.3-p327/gems/sinatra-1.3.3/lib/sinatra/base.rb:1265:in `call'

... snipped for brevity ...

Here is the code:
require 'sinatra'
require 'pusher'
require 'thin'
Thin::HTTP_STATUS_CODES[403] = "FORBIDDEN"

Pusher.app_id = 'MY-APP-ID'
Pusher.key = 'MY-KEY'
Pusher.secret = 'MY-SECRET'

def auth
  response = Pusher[params[:channel_name]].authenticate(params[:socket_id], {:user_id => 101})
  render :json => response
end

 use Rack::Auth::Basic, "Protected Area" do |username, password|
   username == 'foo' && password == 'bar'
 end

 post '/presence/auth' do
   if params[:channel_name] == 'presence-demo'
      auth
   else
   #   render :text => "Forbidden", :status => '403'
   response.status = 403
   end
 end

Can someone provide a suggestion or correct usage of render? 

A:

Here's is what I discovered.  render is associated with Rails, and not strictly Ruby.  To respond to the Sinatra route, use the following in the auth method:
def auth
  response = Pusher[params[:channel_name]].authenticate(params[:socket_id], {:user_id => 101})
  [200, {"Content-Type" => "application/json"}, response.to_json]
end

As it turns out, the Pusher iOS project demo provides a Scripts/auth_server.rb file with the required implementation.  It is documented with the installation instructions here: https://github.com/lukeredpath/libPusher/wiki/Adding-libPusher-to-your-project .