can not install ruby gems code in yocto imx board-maaxboard(compile ruby code in board failed)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

can not install ruby gems code in yocto imx board-maaxboard(compile ruby code in board failed)

724 Views
gonewithwind-peter
Senior Contributor I

hi all:

I think this is a yocto image in board compilation issue. 

we need to run ruby code in my board, we can compile my ruby code with rake, 

but we can not install it with gem.

I do not know what libs I need to add to my local.conf , I have added  something in it:

36 IMAGE_INSTALL_append +=" openssl libcrypto packagegroup-core-buildessential udev jpeg-tools jpeg \

37 kernel-devsrc kernel-modules kernel-dev"

I can compile a c "hello world" in the board successfully eg: it can find #include <stdio.h>,

but in one error output file /usr/lib/ruby/gems/2.5.0/extensions/aarch64-linux/2.5.0/eventmachine-1.2.7/mkmf.log shows :fatal error: stdio.h: No such fil
e or directory

I do not why? and  how to: Provided configuration options:?

thank you.

 

error output:

 

***********

gem install fti-flash-2021.01.01.gem

 

 

Fetching: colorize-0.7.7.gem (100%)
Successfully installed colorize-0.7.7
Fetching: eventmachine-1.2.7.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing fti-flash-2021.01.01.gem:
ERROR: Failed to build gem native extension.

current directory: /usr/lib/ruby/gems/2.5.0/gems/eventmachine-1.2.7/ext
/usr/bin/ruby -r ./siteconf20210125-4047-1w024ru.rb extconf.rb
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/$(RUBY_BASE_NAME)
--with-ssl-dir
--without-ssl-dir
--with-ssl-include
--without-ssl-include=${ssl-dir}/include
--with-ssl-lib
--without-ssl-lib=${ssl-dir}/lib
--with-openssl-config
--without-openssl-config
--with-pkg-config
--without-pkg-config
/usr/lib/ruby/2.5.0/mkmf.rb:456:in `try_do': The compiler failed to generate an)
You have to install development tools first.
from /usr/lib/ruby/2.5.0/mkmf.rb:541:in `try_link0'
from /usr/lib/ruby/2.5.0/mkmf.rb:559:in `try_link'
from /usr/lib/ruby/2.5.0/mkmf.rb:660:in `try_ldflags'
from /usr/lib/ruby/2.5.0/mkmf.rb:1820:in `pkg_config'
from extconf.rb:65:in `pkg_config_wrapper'
from extconf.rb:92:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which ca:

/usr/lib/ruby/gems/2.5.0/extensions/aarch64-linux/2.5.0/eventmachine-1.2.7/mkmf.log

extconf failed, exit code 1

 

 

******

 

-sh-4.4# vi mkmf.log

In file included from /usr/include/ruby-2.5.0/ruby/ruby.h:29:0,
from /usr/include/ruby-2.5.0/ruby.h:33,
from conftest.c:1:
/usr/include/ruby-2.5.0/ruby/defines.h:112:10: fatal error: stdio.h: No such fil
e or directory
#include <stdio.h>
^~~~~~~~~
compilation terminated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5: return 0;
6: }
/* end */

"pkg-config --exists openssl"
| pkg-config --libs openssl
=> "-L/usr//lib -lssl -lcrypto\n"

0 Kudos
0 Replies