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

ruby-packer sets BUNDLE_GEMFILE inside the running script #176

Open
d4rky-pl opened this issue Aug 16, 2023 · 0 comments
Open

ruby-packer sets BUNDLE_GEMFILE inside the running script #176

d4rky-pl opened this issue Aug 16, 2023 · 0 comments

Comments

@d4rky-pl
Copy link

d4rky-pl commented Aug 16, 2023

I'm aware that this project is no longer actively maintained but I'm leaving this info here for the people still using it and googling answers:

When packaging the app, ruby-packer embeds BUNDLE_GEMFILE environment variable inside so it's visible to the script being packed and all the processes spawned by it.

This may trip you over if you try to run system("bundle") inside your code and you will see this error instead:

[!] There was an error parsing `Gemfile`: No such file or directory @ rb_sysopen - /__enclose_io_memfs__/local/Gemfile. Bundler cannot continue.

The workaround for this is to ENV.delete 'BUNDLE_GEMFILE' inside your script. If you still need to support this env var coming from the outside you can add if ENV['BUNDLE_GEMFILE'] == '/__enclose_io_memfs__/local/Gemfile' to ensure you're only clearing the default.

Also shout out to ericbeland/ruby-packer for a working Ruby 3.1 fork 👋

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