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

Error while compiling rails app #12

Closed
novneetnov opened this issue Jul 27, 2017 · 14 comments
Closed

Error while compiling rails app #12

novneetnov opened this issue Jul 27, 2017 · 14 comments

Comments

@novneetnov
Copy link

novneetnov commented Jul 27, 2017

I am using ruby 2.3.3 with Rails 5.0.4
While trying to compile a rails app with ./rubyc bin/rails I ran into an error:

In file included from ./curses.priv.h:325:0,
                 from ../ncurses/lib_gen.c:19:
_29511.c:843:15: error: expected ‘)’ before ‘int’
Makefile:962: recipe for target '../objects/lib_gen.o' failed
make[1]: *** [../objects/lib_gen.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/tmp/rubyc/ncurses/ncurses'
Makefile:113: recipe for target 'all' failed
make: *** [all] Error 2
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"]

And the the output executable binary file was not created. Any light on this?

@pmq20
Copy link
Owner

pmq20 commented Jul 27, 2017

Interesting. This is due to a dependency-library failing to compile, i.e. ncurses. What is your compiler version? Maybe it's too old? You could Google it since this is about ncurses and not related directly to ruby or rubyc.

@novneetnov
Copy link
Author

novneetnov commented Jul 27, 2017

Yeah. You are correct. This was an external error, which I seem to have fixed. But I have run into another error.

ERROR:  Could not find a valid gem '/__enclose_io_memfs__/local/vendor/bundler-1.15.2.gem' (>= 0) in any repository
Failed running [{"CI"=>"true", "PATH"=>"/tmp/rubyc/ruby-2.4.1-0.3.0/build/bin:/home/novneet/.rvm/gems/ruby-2.3.3@rails5/bin:/home/novneet/.rvm/gems/ruby-2.3.3@global/bin:/home/novneet/.rvm/rubies/ruby-2.3.3/bin:/home/novneet/bin:/home/novneet/.local/bin:/home/novneet/.nvm/versions/node/v4.2.3/bin:/home/novneet/bin:/home/novneet/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/novneet/.rvm/bin:/snap/bin:/home/novneet/.rvm/bin:/home/novneet/.rvm/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", "gem install /__enclose_io_memfs__/local/vendor/bundler-1.15.2.gem --force --local --no-rdoc --no-ri"]

I have bundler version 1.15.3. Do I need to downgrade it to v 1.15.2?
Oh and you have not mentioned it the docs, but rubyc works fine with rvm right?

@pmq20
Copy link
Owner

pmq20 commented Jul 28, 2017

@novneetnov This is definitely my fault, since there is another similarly reported issue . Let me fix it ASAP.

#11

@pmq20
Copy link
Owner

pmq20 commented Jul 28, 2017

@novneetnov Weird. I failed to reproduce it locally in the latest master branch (i.e. 0.4.0). Which version of rubyc are you using?

@novneetnov
Copy link
Author

@pmq20 I have downloaded rubyc by the following command:
curl -L http://enclose.io/rubyc/rubyc-linux-x64.gz | gunzip > rubyc
This get me the 0.3.0 version.
How do I get the latest version? Should I clone the master branch locally?

@pmq20
Copy link
Owner

pmq20 commented Jul 29, 2017

@novneetnov Yes, please clone the master branch and then execute from bin/rubyc to see if it is already fixed. I'll release the next version very soon. Thanks!

@pmq20
Copy link
Owner

pmq20 commented Jul 31, 2017

I figured it out. gem cannot read a virtual path. The reason why it works from the master repo is that it is reading a real path. When running from stand-alone nodec or nodec.exe, it is a virtual path.

Fixed in a84edb6

I'll release it in rubyc v0.4.0 as soon as possible.

@obromios
Copy link

obromios commented Jul 31, 2017

I have the same problem, look forward to rubyc v0.4.0

@pmq20
Copy link
Owner

pmq20 commented Aug 14, 2017

@novneetnov @obromios Ruby Compiler v0.4.0 released! Download: http://enclose.io/rubyc

@obromios
Copy link

obromios commented Aug 30, 2017

I downloaded the latest version and checked that ./rubyc --version gives 0.4.0. I am no longer getting the error above, but I get a few problems. I am running on a Mac.

The first is a warning 'The latest bundler is 1.15.4, but you are currently running 1.15.3'. This is puzzling because I am using 1.15.4, and do not have 1.15.3 installed. As well, in the output of the rubyc it actually says it is installing 1.15.3.

Second, there appears to be a fatal error 'Your Ruby version is 2.4.1, but your Gemfile specified 2.2.7
Failed Running...'
Do I need to upgrade to ruby 2.4.1 to use rubyc?

As a sanity check, I ran rubyc on a 'hello world' ruby file.

#!/usr/bin/env ruby
puts 'Hello World'

This also failed, with the error

/__enclose_io_memfs__/local/lib/compiler.rb:678:in `binread': Invalid argument @ io_fread - enclose_io_memfs.squashfs (Errno::EINVAL)
	from /__enclose_io_memfs__/local/lib/compiler.rb:678:in `block in make_enclose_io_memfs'
	from /__enclose_io_memfs__/local/lib/compiler/utils.rb:45:in `block in chdir'
	from /__enclose_io_memfs__/local/lib/compiler/utils.rb:45:in `chdir'
	from /__enclose_io_memfs__/local/lib/compiler/utils.rb:45:in `chdir'
	from /__enclose_io_memfs__/local/lib/compiler.rb:673:in `make_enclose_io_memfs'
	from /__enclose_io_memfs__/local/lib/compiler.rb:485:in `block in run!'
	from /__enclose_io_memfs__/local/lib/compiler/utils.rb:45:in `block in chdir'
	from /__enclose_io_memfs__/local/lib/compiler/utils.rb:45:in `chdir'
	from /__enclose_io_memfs__/local/lib/compiler/utils.rb:45:in `chdir'
	from /__enclose_io_memfs__/local/lib/compiler.rb:365:in `run!'
	from /__enclose_io_memfs__/local/bin/rubyc:149:in `<main>'

@pmq20
Copy link
Owner

pmq20 commented Aug 31, 2017

@obromios Regarding the sanity check, it looks as though enclose_io_memfs.squashfs does not exist. Could you paste more log so that I can inspect about the generating of enclose_io_memfs.squashfs?

@drbrain
Copy link
Collaborator

drbrain commented May 9, 2018

Closing due to lack of response.

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

error about ncurses fixed by
export CPPFLAGS="-P"

@Githubsectest
Copy link

@obromios Regarding the sanity check, it looks as though enclose_io_memfs.squashfs does not exist. Could you paste more log so that I can inspect about the generating of enclose_io_memfs.squashfs?

-> rm -f /tmp/rubyc/rubyc_work_dir/enclose_io_memfs/lib/ruby/2.4.0/x86_64-linux/enc/utf_16le.so
-> rm -f /tmp/rubyc/rubyc_work_dir/enclose_io_memfs/lib/ruby/2.4.0/x86_64-linux/enc/utf_32be.so
-> rm -f /tmp/rubyc/rubyc_work_dir/enclose_io_memfs/lib/ruby/2.4.0/x86_64-linux/enc/utf_32le.so
-> rm -f /tmp/rubyc/rubyc_work_dir/enclose_io_memfs/lib/ruby/2.4.0/x86_64-linux/enc/windows_31j.so
-> rm -f /tmp/rubyc/rubyc_work_dir/enclose_io_memfs/lib/ruby/2.4.0/x86_64-linux/enc/windows_1250.so
-> rm -f /tmp/rubyc/rubyc_work_dir/enclose_io_memfs/lib/ruby/2.4.0/x86_64-linux/enc/windows_1251.so
-> rm -f /tmp/rubyc/rubyc_work_dir/enclose_io_memfs/lib/ruby/2.4.0/x86_64-linux/enc/windows_1252.so
-> rm -f /tmp/rubyc/rubyc_work_dir/enclose_io_memfs/lib/ruby/2.4.0/x86_64-linux/enc/windows_1253.so
-> rm -f /tmp/rubyc/rubyc_work_dir/enclose_io_memfs/lib/ruby/2.4.0/x86_64-linux/enc/windows_1254.so
-> rm -f /tmp/rubyc/rubyc_work_dir/enclose_io_memfs/lib/ruby/2.4.0/x86_64-linux/enc/windows_1257.so
-> cd /opt/rubyc
-> cp -r "/opt/rubyc" "/tmp/rubyc/rubyc_work_dir/enclose_io_memfs/local"
-> cd /tmp/rubyc/rubyc_work_dir/enclose_io_memfs/local
-> cd bin
/enclose_io_memfs/local/lib/compiler/utils.rb:45:in chdir': No such file or directory @ dir_chdir - bin (Errno::ENOENT) from /__enclose_io_memfs__/local/lib/compiler/utils.rb:45:in chdir'
from /enclose_io_memfs/local/lib/compiler.rb:645:in block (2 levels) in prepare_local' from /__enclose_io_memfs__/local/lib/compiler/utils.rb:45:in block in chdir'
from /enclose_io_memfs/local/lib/compiler/utils.rb:45:in chdir' from /__enclose_io_memfs__/local/lib/compiler/utils.rb:45:in chdir'
from /enclose_io_memfs/local/lib/compiler.rb:635:in block in prepare_local' from /__enclose_io_memfs__/local/lib/compiler/utils.rb:45:in block in chdir'
from /enclose_io_memfs/local/lib/compiler/utils.rb:45:in chdir' from /__enclose_io_memfs__/local/lib/compiler/utils.rb:45:in chdir'
from /enclose_io_memfs/local/lib/compiler.rb:527:in prepare_local' from /__enclose_io_memfs__/local/lib/compiler.rb:464:in block in run!'
from /enclose_io_memfs/local/lib/compiler/utils.rb:45:in block in chdir' from /__enclose_io_memfs__/local/lib/compiler/utils.rb:45:in chdir'
from /enclose_io_memfs/local/lib/compiler/utils.rb:45:in chdir' from /__enclose_io_memfs__/local/lib/compiler.rb:365:in run!'
from /enclose_io_memfs/local/bin/rubyc:149:in `

'

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

6 participants