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 Typesense::Documents::ERB #34

Closed
aravindanf22labs opened this issue Oct 7, 2024 · 3 comments · Fixed by #36
Closed

uninitialized constant Typesense::Documents::ERB #34

aravindanf22labs opened this issue Oct 7, 2024 · 3 comments · Fixed by #36

Comments

@aravindanf22labs
Copy link

aravindanf22labs commented Oct 7, 2024

Description

I successfully created a collection by name ads_new. I am able to retrieve collections and documents with

@typesense.collections.retrieve
@typesense.collections['ads_new']

When I try import / upsert documents, I get the following errors.

@typesense.collections['ads_new'].documents.import(ads, action: 'create')
@typesense.collections['ads_new'].documents.upsert(ads.first)

uninitialized constant Typesense::Documents::ERB

Complete error :
/usr/local/bundle/gems/typesense-2.0.0/lib/typesense/documents.rb:78:in `endpoint_path': uninitialized constant Typesense::Documents::ERB (NameError)
#{Collections::RESOURCE_PATH}/#{ERB::Util.url_encode(@collection_name)}#{Documents::RESOURCE_PATH}#{operation.nil? ? '' : "/#{operation}"}

Steps to reproduce

Expected Behavior

documents must be successfully inserted.

Actual Behavior

Unable to insert docuements.

Metadata

Server - 27.1, gem - 2.0.0

OS:
Uploading Screenshot 2024-10-07 at 6.43.38 AM.png…

haydenhoang added a commit to haydenhoang/typesense-ruby that referenced this issue Oct 8, 2024
- explicitly require 'uri'. resolve typesense#34
- uri is a lighter library compared to erb
haydenhoang added a commit to haydenhoang/typesense-ruby that referenced this issue Oct 8, 2024
- explicitly require 'uri'. resolve typesense#34
- uri is a lighter library compared to erb
@haydenhoang
Copy link
Contributor

Hi @aravindanf22labs, could you provide the ruby version you are using?

@aravindanf22labs
Copy link
Author

ruby:3.1.2

@haydenhoang
Copy link
Contributor

@aravindanf22labs could you verify using v2.1.0.rc1?

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