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

Fail on running the binary build for my rails 4.2 #30

Closed
ivanyucp opened this issue Jan 2, 2018 · 4 comments
Closed

Fail on running the binary build for my rails 4.2 #30

ivanyucp opened this issue Jan 2, 2018 · 4 comments

Comments

@ivanyucp
Copy link

ivanyucp commented Jan 2, 2018

I tried to compile my Rails 4.2 project on Ruby 2.4.2 in OSX 10.13.2. It took nearly an 70 minutes to complete. The binary file is 779M (it's a large project with a lot of testing code). When I try to run it, it product the below error message and crashed, could you please help? Thanks a lot!

$ ./a.out
/__enclose_io_memfs__/local/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.0.0/lib/bootsnap/compile_cache/iseq.rb:40:in `fetch': No such file or directory (Errno::ENOENT)
	from /__enclose_io_memfs__/local/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.0.0/lib/bootsnap/compile_cache/iseq.rb:40:in `load_iseq'
	from /__enclose_io_memfs__/local/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.0.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:17:in `require'
	from /__enclose_io_memfs__/local/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.0.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:17:in `require'
	from /__enclose_io_memfs__/local/vendor/bundle/ruby/2.4.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:274:in `block in require'
	from /__enclose_io_memfs__/local/vendor/bundle/ruby/2.4.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:240:in `load_dependency'
	from /__enclose_io_memfs__/local/vendor/bundle/ruby/2.4.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:274:in `require'
	from /__enclose_io_memfs__/local/bin/rails:8:in `<main>'

Please note that compiling and run Rails 5 sample app seems works in the same environment.

@yourivdlans
Copy link
Contributor

I've had the same trouble when compiling a Rails 5 app. After removing bootsnap from the Gemfile and commenting out the line require 'bootsnap/setup' from config/boot.rb it was able to compile and start a server.

@drbrain
Copy link
Collaborator

drbrain commented May 9, 2018

bootsnap is incompatible with rubyc because it uses open(2) instead of ruby's IO methods meaning it bypasses the memfs lookup:

https://github.com/Shopify/bootsnap/blob/4bd3c2b7dbd85772e218dd813791ecb0029e70fe/ext/bootsnap/bootsnap.c#L301

Maybe you can disable only the part of bootsnap that routes through that method?

If bootsnap were patched to use ruby's IO methods I'm unsure what speed benefit you could get with rubyc as the files are all in memory already, it would require some benchmarking.

@drbrain drbrain closed this as completed May 9, 2018
@yourivdlans
Copy link
Contributor

If bootsnap were patched to use ruby's IO methods I'm unsure what speed benefit you could get with rubyc as the files are all in memory already, it would require some benchmarking.

I agree, maybe we could add a note in the readme for this.

@drbrain
Copy link
Collaborator

drbrain commented May 10, 2018

Done! ↑

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

3 participants