pmq20 / ruby-packer

Packing your Ruby application into a single executable.
MIT License
1.56k stars 99 forks source link

No output file after compiling #5

Closed tony612 closed 7 years ago

tony612 commented 7 years ago

No output file is produced after compiling my Rails project using rubyc bin/rails. Found this log in the end:

-> cd bin
Cannot find entrance /path/to/myproject/bin/rails, available entrances are _guard-core, aws.rb, 
bootstrap, bundle, byebug, coderay, commander, db_drop, db_migrate, erubis, fluent-post, git-
version-bump, god, guard, htmldiff, httparty, iap, ipip, ldiff, listen, mojibake, mongrel_rpm, newrelic, 
newrelic_cmd, nokogiri, nrdebug, protoc-gen-ruby, pry, puma, pumactl, rackup, rails, rake, 
restclient, rotp, rpc_server, rspec, rubocop, ruby-parse, ruby-prof, ruby-prof-check-trace, ruby-
rewrite, safe_yaml, setup, sidekiq, sidekiqctl, slimrb, spork, sprockets, stackprof, stackprof-
flamegraph.pl, stackprof-gprof2dot.py, thin, thor, tilt, unicorn, unicorn_rails, uuid.

OS: macOS 10.12.5 ruby version: 2.4.0 rubyc version: Ruby Compiler (rubyc) v0.1.0 (runtime 2.4.0) rails version: 4.2.8

pmq20 commented 7 years ago

v0.1.0 is pretty old. Let me release v0.2.0 now. Just a sec

pmq20 commented 7 years ago

http://enclose.io/rubyc

tony612 commented 7 years ago

@pmq20 Got another error

-> Running [{"CI"=>"true", "ENCLOSE_IO_USE_ORIGINAL_RUBY"=>"1", "CFLAGS"=>" -fPIC -O3 -fno-fast-math -ggdb3 -Os -fdata-sections -ffunction-sections -pipe ", "LDFLAGS"=>""}, "make -j4"]
CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/sh /private/var/folders/8v/r_z7qgls0hzcc22yc8zmpdl40000gn/T/rubyc/gdbm/build-aux/missing aclocal-1.14 -I m4
/private/var/folders/8v/r_z7qgls0hzcc22yc8zmpdl40000gn/T/rubyc/gdbm/build-aux/missing: line 81: aclocal-1.14: command not found
WARNING: 'aclocal-1.14' is missing on your system.
         You should only need it if you modified 'acinclude.m4' or
         'configure.ac' or m4 files included by 'configure.ac'.
         The 'aclocal' program is part of the GNU Automake package:
         <http://www.gnu.org/software/automake>
         It also requires GNU Autoconf, GNU m4 and Perl in order to run:
         <http://www.gnu.org/software/autoconf>
         <http://www.gnu.org/software/m4/>
         <http://www.perl.org/>
make: *** [aclocal.m4] Error 127
Failed running [{"CI"=>"true", "ENCLOSE_IO_USE_ORIGINAL_RUBY"=>"1", "CFLAGS"=>" -fPIC -O3 -fno-fast-math -ggdb3 -Os -fdata-sections -ffunction-sections -pipe ", "LDFLAGS"=>""}, "make -j4"]
tony612 commented 7 years ago

I found I have aclocal(1.15)

$ aclocal --version
aclocal (GNU automake) 1.15
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl-2.0.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Tom Tromey <tromey@redhat.com>
       and Alexandre Duret-Lutz <adl@gnu.org>.
pelted commented 7 years ago

Yup needed to brew install automake in order to get the aclocal dependency dealt with. But still failing.

configure: error: something wrong with LDFLAGS=" -L/var/folders/z9/38cxxvz94y7_zf2m4_4rc7r40000gn/T/rubyc/zlib /var/folders/z9/38cxxvz94y7_zf2m4_4rc7r40000gn/T/rubyc/zlib/libz.a  -L/var/folders/z9/38cxxvz94y7_zf2m4_4rc7r40000gn/T/rubyc/openssl  -L/var/folders/z9/38cxxvz94y7_zf2m4_4rc7r40000gn/T/rubyc/gdbm/build/lib  -L/var/folders/z9/38cxxvz94y7_zf2m4_4rc7r40000gn/T/rubyc/yaml/build/lib  -L/var/folders/z9/38cxxvz94y7_zf2m4_4rc7r40000gn/T/rubyc/libffi/build/lib  -L/var/folders/z9/38cxxvz94y7_zf2m4_4rc7r40000gn/T/rubyc/ncurses/build/lib  -L/var/folders/z9/38cxxvz94y7_zf2m4_4rc7r40000gn/T/rubyc/readline/build/lib "
Failed running [{"CI"=>"true", "ENCLOSE_IO_USE_ORIGINAL_RUBY"=>"1", "CFLAGS"=>" -fPIC -O3 -fno-fast-math -ggdb3 -Os -fdata-sections -ffunction-sections -pipe  -I/var/folders/z9/38cxxvz94y7_zf2m4_4rc7r40000gn/T/rubyc/zlib  -I/var/folders/z9/38cxxvz94y7_zf2m4_4rc7r40000gn/T/rubyc/openssl/include  -I/var/folders/z9/38cxxvz94y7_zf2m4_4rc7r40000gn/T/rubyc/gdbm/build/include  -I/var/folders/z9/38cxxvz94y7_zf2m4_4rc7r40000gn/T/rubyc/yaml/build/include  -I/var/folders/z9/38cxxvz94y7_zf2m4_4rc7r40000gn/T/rubyc/libffi/build/lib/libffi-3.2.1/include  -I/var/folders/z9/38cxxvz94y7_zf2m4_4rc7r40000gn/T/rubyc/ncurses/build/include  -I/var/folders/z9/38cxxvz94y7_zf2m4_4rc7r40000gn/T/rubyc/readline/build/include ", "LDFLAGS"=>" -L/var/folders/z9/38cxxvz94y7_zf2m4_4rc7r40000gn/T/rubyc/zlib /var/folders/z9/38cxxvz94y7_zf2m4_4rc7r40000gn/T/rubyc/zlib/libz.a  -L/var/folders/z9/38cxxvz94y7_zf2m4_4rc7r40000gn/T/rubyc/openssl  -L/var/folders/z9/38cxxvz94y7_zf2m4_4rc7r40000gn/T/rubyc/gdbm/build/lib  -L/var/folders/z9/38cxxvz94y7_zf2m4_4rc7r40000gn/T/rubyc/yaml/build/lib  -L/var/folders/z9/38cxxvz94y7_zf2m4_4rc7r40000gn/T/rubyc/libffi/build/lib  -L/var/folders/z9/38cxxvz94y7_zf2m4_4rc7r40000gn/T/rubyc/ncurses/build/lib  -L/var/folders/z9/38cxxvz94y7_zf2m4_4rc7r40000gn/T/rubyc/readline/build/lib ", "ENCLOSE_IO_RUBYC_1ST_PASS"=>"1", "ENCLOSE_IO_RUBYC_2ND_PASS"=>nil}, "./configure
pmq20 commented 7 years ago

@pelted @pelted auto tools should not be needed. This is indeed a bug. Thanks for reporting.

Git lost track of modification time of some source code, resulting in make thinking that auto-configure is needed to be re-run. Fixed in fa8db11

tony612 commented 7 years ago

@pmq20 Great! I'll try when the new release is out.

tony612 commented 7 years ago

@pmq20 Could you release the new version so that I can verify if it's fixed?

pmq20 commented 7 years ago

@tony612 You could just clone the repo and try the master branch. Just use bin/rubyc instead of plain rubyc.

tony612 commented 7 years ago

@pmq20 I tried to use the master branch, but got this error:

Fetching source index from https://gems.ruby-china.org/

Retrying fetcher due to error (2/4): Bundler::Fetcher::CertificateFailureError Could not verify the SSL certificate for https://gems.ruby-china.org/.
There is a chance you are experiencing a man-in-the-middle attack, but most likely your system doesn't have the CA certificates needed for verification. For information about OpenSSL certificates, see http://bit.ly/ruby-ssl. To connect without using SSL, edit your Gemfile sources and change 'https' to 'http'.
Retrying fetcher due to error (3/4): Bundler::Fetcher::CertificateFailureError Could not verify the SSL certificate for https://gems.ruby-china.org/.
There is a chance you are experiencing a man-in-the-middle attack, but most likely your system doesn't have the CA certificates needed for verification. For information about OpenSSL certificates, see http://bit.ly/ruby-ssl. To connect without using SSL, edit your Gemfile sources and change 'https' to 'http'.
Retrying fetcher due to error (4/4): Bundler::Fetcher::CertificateFailureError Could not verify the SSL certificate for https://gems.ruby-china.org/.
There is a chance you are experiencing a man-in-the-middle attack, but most likely your system doesn't have the CA certificates needed for verification. For information about OpenSSL certificates, see http://bit.ly/ruby-ssl. To connect without using SSL, edit your Gemfile sources and change 'https' to 'http'.
Could not verify the SSL certificate for https://gems.ruby-china.org/.
There is a chance you are experiencing a man-in-the-middle attack, but most likely your system doesn't have the CA certificates needed for verification. For information about OpenSSL certificates, see http://bit.ly/ruby-ssl. To connect without using SSL, edit your Gemfile sources and change 'https' to 'http'.
Failed running [{"CI"=>"true", "PATH"=>"/var/folders/8v/r_z7qgls0hzcc22yc8zmpdl40000gn/T/rubyc/ruby/build/bin:/Users/tony/.rbenv/versions/2.4.1/bin:/usr/local/Cellar/rbenv/1.1.0/libexec:/Users/tony/.rbenv/plugins/rbenv-binstubs/bin:/Users/tony/scripts:/Users/tony/.rbenv/shims:/usr/local/heroku/bin:/usr/local/share/npm/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin", "GEM_HOME"=>nil, "GEM_PATH"=>nil, "ENCLOSE_IO_USE_ORIGINAL_RUBY"=>"1", "ENCLOSE_IO_RUBYC_1ST_PASS"=>"1", "ENCLOSE_IO_RUBYC_2ND_PASS"=>nil}, "sh", "-c", "bundle install --deployment"]

I tried three times and got this error every time. When I run bundle install without rubyc, it works.

Then I change ruby-china gems to http, it works. But I'm not sure if it's the problem of ruby-compiler or gems.ruby-china.org.

pmq20 commented 7 years ago

@tony612 Thanks for reporting. This is probably due to a problem with ruby-compiler since it is using a freshly-built local toolchain to do the bundle install process. Let me see if I could reproduce this locally.

tony612 commented 7 years ago

My problem should be fixed on master. Closing this. Thank you!