Skip to content

Instantly share code, notes, and snippets.

@amw amw/output
Created Nov 5, 2012

Embed
What would you like to do?
Uninitialized constants in zendesk API
$ruby zentest.rb
W, [2012-11-05T16:32:03.672936 #15942] WARN -- : ZendeskAPI::User - find
W, [2012-11-05T16:32:03.673034 #15942] WARN -- : uninitialized constant ZendeskAPI::Middleware::Response::Gzip::Zlib
W, [2012-11-05T16:32:03.673071 #15942] WARN -- : /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/zendesk_api-0.1.10/lib/zendesk_api/middleware/response/gzip.rb:11:in `block in <class:Gzip>'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/faraday_middleware-0.9.0/lib/faraday_middleware/response_middleware.rb:48:in `call'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/faraday_middleware-0.9.0/lib/faraday_middleware/response_middleware.rb:48:in `parse'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/faraday_middleware-0.9.0/lib/faraday_middleware/response_middleware.rb:39:in `process_response'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/faraday_middleware-0.9.0/lib/faraday_middleware/response_middleware.rb:32:in `block in call'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/faraday-0.8.4/lib/faraday/response.rb:63:in `on_complete'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/faraday_middleware-0.9.0/lib/faraday_middleware/response_middleware.rb:30:in `call'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/faraday_middleware-0.9.0/lib/faraday_middleware/response_middleware.rb:30:in `call'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/zendesk_api-0.1.10/lib/zendesk_api/middleware/response/parse_iso_dates.rb:11:in `call'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/faraday-0.8.4/lib/faraday/response.rb:8:in `call'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/zendesk_api-0.1.10/lib/zendesk_api/middleware/response/logger.rb:20:in `call'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/faraday-0.8.4/lib/faraday/response.rb:8:in `call'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/faraday-0.8.4/lib/faraday/response.rb:8:in `call'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/faraday-0.8.4/lib/faraday/request/authorization.rb:36:in `call'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/faraday-0.8.4/lib/faraday/connection.rb:226:in `run_request'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/faraday-0.8.4/lib/faraday/connection.rb:87:in `get'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/zendesk_api-0.1.10/lib/zendesk_api/actions.rb:91:in `find'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/zendesk_api-0.1.10/lib/zendesk_api/rescue.rb:28:in `block (2 levels) in rescue_client_error'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/zendesk_api-0.1.10/lib/zendesk_api/collection.rb:69:in `find'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/zendesk_api-0.1.10/lib/zendesk_api/client.rb:50:in `current_user'
zentest.rb:14:in `<main>'
nil
zentest.rb:22:in `<main>': undefined method `id' for nil:NilClass (NoMethodError)
require "zendesk_api"
require "faraday"
client = ZendeskAPI::Client.new do |config|
config.url = "https://mysite.zendesk.com/api/v2"
config.username = "myemail@example.net"
config.password = "mypassword"
config.retry = true
config.adapter = :patron
end
user = client.current_user
ticket = ZendeskAPI::Ticket.new(client,
subject: "Test Ticket",
description: "Testign zendesk API",
comment: {:value => "This is a test" },
requester: {email: "someone@gmail.com", name: "Someone"},
:submitter_id => user.id,
priority: "urgent",
tags: ["bug_report"])
ticket.save
puts ticket.inspect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.