-
Notifications
You must be signed in to change notification settings - Fork 445
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
Tag 0.3.7 doesn't respect FREEDESKTOP_MIME_TYPES_PATH env variable #131
Comments
That's odd. If I download version 0.3.7 it contains Note that the variable has to be set at installation time. |
We have set the ENV var before the bundle install starts. The problem is, in lambda environments, the file systems are not writable. Only /tmp folder can be used for writing any files. Could that be the reason why the path from ENV is not used by tables.rb while accessing MimeMagic::DATABASE_PATH? |
Yes, the file system not being writable could be a problem. What messages are you getting during both installation and use? Does the generated |
We keep getting this error, even after setting the ENV variable to the correct path which is available at runtime.
|
I suspect this is related to #121 |
The ENV isn't read at runtime, only install time. For a Lambda package, you should be building it locally with a vendored gem installation location (e.g., One solution would be to perhaps do this check on install as normal, but also support picking up the ENV on load too. |
Rubygems and Lambda functions are a pain, and this is going to be particularly painful I’m afraid because we store the full file path at build time, which will be different to the path in the Lambda’s environment. It does sound like checking for the environment variable at runtime and using that if set is probably the best option here. |
Please install shared-mime-info and add FREEDESKTOP_MIME_TYPES_PATH in your environment. |
D:\Ruby27-x64\lib\ruby\gems\2.7.0\extensions\x64-mingw32\2.7.0\mimemagic-0.4.3\mimemagic\path.rb class MimeMagic |
I upgraded mimemagic to 0.3.7 to fix the issue due to yanked versions.
gem 'mimemagic', '0.3.7'
But the downloaded code for the gem doesn't have any reference to the FREEDESKTOP_MIME_TYPES_PATH env variable.
In environments like AWS Lambda where the freedesktop.org.xml is not present in the locations defined in the gem, the deployments are failing due to this.
How could we address this?
The text was updated successfully, but these errors were encountered: