termux / termux-packages

A package build system for Termux.
https://termux.dev
Other
13.27k stars 3.06k forks source link

Error while installing gems with native extensions inside docker #1402

Open Auxilus opened 7 years ago

Auxilus commented 7 years ago

While building https://github.com/termux/termux-packages/pull/1361 the docker is showing error while installing gems with native extensions, other gems ( that don't need native extensions like mini_portile from the screenshot ) install correctly.

The error says :

Fetching: nokogiri-1.8.0.gem (100%)                                                                                                                                                                                                            
Building native extensions with: '--use-system-libraries'                                                                                                                                                                                      
This could take a while...                                                                                                                                                                                                                     
ERROR:  Error installing nokogiri:                                                                                                                                                                                                             
        ERROR: Failed to build gem native extension.                                                                                                                                                                                           

    current directory: /data/data/com.termux/files/usr/lib/ruby/gems/2.4.0/gems/nokogiri-1.8.0/ext/nokogiri                                                                                                                                    
/usr/bin/ruby2.3 -r ./siteconf20170908-28503-n1y73u.rb extconf.rb --use-system-libraries                                                                                                                                                       
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h                                                                                                                                                                       

extconf failed, exit code 1                                                                                                                                                                                                                    

Gem files will remain installed in /data/data/com.termux/files/usr/lib/ruby/gems/2.4.0/gems/nokogiri-1.8.0 for inspection.                                                                                                                     
Results logged to /data/data/com.termux/files/usr/lib/ruby/gems/2.4.0/extensions/x86_64-linux/2.3.0/nokogiri-1.8.0/gem_make.out                                                                                                                

screenshot_20170908-152731

Grimler91 commented 7 years ago

ruby.h seem to be at $PREFIX/include/ruby-2.4.0/ruby.h so try symlinking it to the include dir

Auxilus commented 7 years ago

Like ln -s $PREFIX/include/ruby-2.4.0/ruby.h /usr/lib/ruby/include/?

Auxilus commented 7 years ago

Still got the error screenshot_20170908-171002 Check https://github.com/Auxilus/termux-packages/blob/08bca9c9c3e0615d9175353de57fe57ba5d120b0/packages/metasploit-framework/build.sh#L62

Auxilus commented 7 years ago

Is ruby.h even there at $PREFIX/include/ruby-2.4.0/ruby.h ?

Grimler91 commented 7 years ago

If ruby is in termux_pkg_depends, then yeah, otherwise no

Grimler91 commented 7 years ago

$PREFIX won't work though since we are in the docker image, use $TERMUX_PREFIX

Auxilus commented 7 years ago

K

Auxilus commented 7 years ago

Yeah doint it atm ty..

Auxilus commented 7 years ago

@Grimler91 still got the error https://raw.githubusercontent.com/Auxilus/termux-packages/3e8aaa4df5c4f8bf7a3a3cb4663980019c3ed1fe/packages/metasploit-framework/build.sh

Auxilus commented 7 years ago

@Grimler91 it says no such dir called /usr/lib/ruby/include/

Grimler91 commented 7 years ago

Yeah, that's a weird path..

ln -s $TERMUX_PREFIX/include/ruby-2.4.0/ruby.h /usr/lib/ruby/include/ should be ln -s $TERMUX_PREFIX/include/ruby-2.4.0/ruby.h $TERMUX_PREFIX/include/

Auxilus commented 7 years ago

@Grimler91 still not working, can you please take a look? Code : https://raw.githubusercontent.com/Auxilus/termux-packages/4dec3b8392e8ab534c398aa94631b77e592886a6/packages/metasploit-framework/build.sh

Execution : https://tmate.io/t/ro-jqGnv00vKRC7WJ8PsbcwAo0um

Auxilus commented 7 years ago

also it says no dir when i do symlink to $TERMUX_PREFIX/lib/ruby/include/ , Do I have to create $TERMUX_PREFIX/lib/ruby/include/ ?

Droid-MAX commented 5 years ago

I also got some errors when I updated the package, and then metasploit could not be used.

ghost commented 5 years ago

Use metasploit from unstable repo - this is only way to get it working.

pkg upgrade
pkg install unstable-repo
pkg install metasploit
stale[bot] commented 2 years ago

This issue/PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.