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

Issue with using it in AWS Lambda functions #489

Closed
sridharraman opened this issue Oct 31, 2022 · 2 comments
Closed

Issue with using it in AWS Lambda functions #489

sridharraman opened this issue Oct 31, 2022 · 2 comments

Comments

@sridharraman
Copy link

I tried using the pg gem for connecting to an RDS database from an AWS Lambda function. Unfortunately, the function throws an error like this:

"errorMessage": "libpq.so.5: cannot open shared object file: No such file or directory - /var/task/vendor/bundle/ruby/2.7.0/gems/pg-1.4.4/lib/pg_ext.so",

When I checked online, they recommend setting up a docker-lambda instance that installs postgresql as well. Is there no way of using this gem without having postgresql installed? I am using it to connect to a remote database, would I still need postgresql installed?

Interestingly, a similar library in node.js (pg) works fine as it doesn't seem to need additional dependencies. Is there anything I can do (apart from moving my lambda code from ruby to js?)

@larskanis
Copy link
Collaborator

You must install libpq in order to use the pg.gem (the full postgresql server installation isn't necessary), which is kind of

sudo apt install libpq-dev 

or so. This is similar to the mysql2.gem. There are certainly proper ways to do this in AWS Lambda.

@larskanis
Copy link
Collaborator

This will probably solved when #480 is implemented.

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