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

no home environment when run on lambda #11

Open
edmamerto opened this issue Feb 7, 2020 · 1 comment
Open

no home environment when run on lambda #11

edmamerto opened this issue Feb 7, 2020 · 1 comment

Comments

@edmamerto
Copy link

When dogscaler client is run on lambda, the logical way to do this is store your ruby libraries in a lambda layer and call the dogscaler binary from the lambda layer path.

When calling the client as if we were running it in the terminal like this:

def lambdaHandler(event:, context:)
	output = `/opt/2.5.0/bin/dogscaler`
	p output
end

I get this error:

/opt/2.5.0/gems/dogscaler-2.0.10/lib/settings.rb:31:in expand_path': couldn't find login name -- expanding ~' (ArgumentError)

Solution is to set a home dir when it's nil

if ENV['HOME'].nil?
  require 'etc'
  ENV['HOME'] = Etc.getpwuid.dir
end
@edmamerto
Copy link
Author

#12

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

1 participant