-
Notifications
You must be signed in to change notification settings - Fork 32
Open
Description
CGI has been removed from the standard library and must be required as a gem dependency1. This requires users to add the CGI dependency explicitly when using the Anthropic SDK in a standalone Ruby library otherwise the gem fails with a runtime error2:
NoMethodError: undefined method 'parse' for class CGI
/opt/hostedtoolcache/Ruby/4.0.0/x64/lib/ruby/gems/4.0.0/gems/anthropic-1.16.2/lib/anthropic/internal/util.rb:275:in 'Anthropic::Internal::Util.decode_query'
/opt/hostedtoolcache/Ruby/4.0.0/x64/lib/ruby/gems/4.0.0/gems/anthropic-1.16.2/lib/anthropic/internal/util.rb:296:in 'Anthropic::Internal::Util.parse_uri'
/opt/hostedtoolcache/Ruby/4.0.0/x64/lib/ruby/gems/4.0.0/gems/anthropic-1.16.2/lib/anthropic/internal/transport/base_client.rb:209:in 'Anthropic::Internal::Transport::BaseClient#initialize'
/opt/hostedtoolcache/Ruby/4.0.0/x64/lib/ruby/gems/4.0.0/gems/anthropic-1.16.2/lib/anthropic/client.rb:126:in 'Anthropic::Client#initialize'| CGI.parse(query.to_s) |
Ideally the anthropic SDK should declare the CGI gem as a dependency to avoid requiring users to explicitly add transitive dependencies in their Gemfiles or gemspecs.
Footnotes
Metadata
Metadata
Assignees
Labels
No labels