Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uninitialized constant Chroma::APIOperations::Data (NameError) #8

Closed
andreibondarev opened this issue May 18, 2023 · 8 comments
Closed

Comments

@andreibondarev
Copy link

Error stack:

 -> langchain [main*]: irb
irb(main):001:0> require 'chroma-db'
/Users/andrei/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/chroma-db-0.2.0/lib/chroma/api_operations/request.rb:11:in `<module:APIOperations>': uninitialized constant Chroma::APIOperations::Data (NameError)

    Response = Data.define(:status, :body, :headers, :error)
               ^^^^
	from /Users/andrei/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/chroma-db-0.2.0/lib/chroma/api_operations/request.rb:4:in `<module:Chroma>'
	from /Users/andrei/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/chroma-db-0.2.0/lib/chroma/api_operations/request.rb:3:in `<top (required)>'
	from /Users/andrei/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/chroma-db-0.2.0/lib/chroma-db.rb:14:in `require_relative'
	from /Users/andrei/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/chroma-db-0.2.0/lib/chroma-db.rb:14:in `<top (required)>'
	from <internal:/Users/andrei/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:160:in `require'
	from <internal:/Users/andrei/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:160:in `rescue in require'
	from <internal:/Users/andrei/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:149:in `require'
	from (irb):1:in `<main>'
	from /Users/andrei/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/irb-1.6.4/exe/irb:9:in `<top (required)>'
	from /Users/andrei/.asdf/installs/ruby/3.1.2/bin/irb:25:in `load'
	from /Users/andrei/.asdf/installs/ruby/3.1.2/bin/irb:25:in `<main>'
<internal:/Users/andrei/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- chroma-db (LoadError)
	from <internal:/Users/andrei/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from (irb):1:in `<main>'
	from /Users/andrei/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/irb-1.6.4/exe/irb:9:in `<top (required)>'
	from /Users/andrei/.asdf/installs/ruby/3.1.2/bin/irb:25:in `load'
	from /Users/andrei/.asdf/installs/ruby/3.1.2/bin/irb:25:in `<main>'
irb(main):002:0>
@andreibondarev
Copy link
Author

andreibondarev commented May 18, 2023

@mariochavez Also -- would it be possible to relax the Ruby version requirement for those installing the gem with an earlier Ruby version? https://github.com/mariochavez/chroma/blob/main/chroma-db.gemspec#L15

I'd recommend going down to ">= 2.6.0"

@mariochavez
Copy link
Owner

Hi!

The gem uses the newest Ruby syntax; it will not work with Ruby 3.1 or older. Needs 3.2 or better.
Changing the gem code to relax the Ruby version means a rewrite of this gem.

I'll try to add Ruby Next to polyfill the newest syntax to older Ruby, but I can't make any commitment that this will work.

Mario

@mariochavez
Copy link
Owner

I'm releasing a new version of this gem. It uses ruby-next to provide backward compatibility with older versions of ruby down to 2.7.8

#9

@andreibondarev
Copy link
Author

Wow @mariochavez, incredible job! Thank you so much for knocking this out so quickly!

@mariochavez
Copy link
Owner

Closing this for now.

@andreibondarev
Copy link
Author

@mariochavez I'm up and running! Thank you sir!

@andreibondarev
Copy link
Author

@mariochavez It's integrated into langchain.rb now: patterns-ai-core/langchainrb#20

@mariochavez
Copy link
Owner

@andreibondarev awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants