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

Can't install nokogiri 1.14.5 #260

Closed
wakhidrf opened this issue Nov 21, 2023 · 113 comments
Closed

Can't install nokogiri 1.14.5 #260

wakhidrf opened this issue Nov 21, 2023 · 113 comments
Labels

Comments

@wakhidrf
Copy link

Installing nokogiri 1.14.5 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
/data/data/com.termux/files/usr/lib/ruby/gems/3.2.0/gems/nokogiri-1.14.5/ext/nokogiri
/data/data/com.termux/files/usr/bin/ruby extconf.rb
--use-system-libraries
--with-xml2-include=/data/data/com.termux/files/usr/include/libxml2
checking for whether -std=c99 is accepted as CFLAGS... yes
checking for whether -Wno-declaration-after-statement is accepted as
CFLAGS... yes
checking for whether -O2 is accepted as CFLAGS... yes
checking for whether -g is accepted as CFLAGS... yes
checking for whether -Winline is accepted as CFLAGS... yes
checking for whether -Wmissing-noreturn is accepted as CFLAGS... yes
checking for whether -Wconversion -Wno-sign-conversion is accepted as CFLAGS... yes
Building nokogiri using system libraries. checking for gzdopen() in -lz... yes
checking for xmlParseDoc() in -lxml2... yes checking for xsltParseStylesheetDoc() in -lxslt... yes
checking for exsltFuncRegister() in -lexslt... yes Using mini_portile version 2.8.5
---------- IMPORTANT NOTICE ---------- Building Nokogiri with a packaged version of libgumbo-1.0.0-nokogiri.
Configuration options: --enable-shared --disable-static Copying gumbo-parser files into
tmp/aarch64-unknown-linux-android/ports/libgumbo/1.0.0-nokogiri/gumbo-parser...
Running 'compile' for libgumbo 1.0.0-nokogiri... OK Activating libgumbo 1.0.0-nokogiri (from
ports/aarch64-linux-android/libgumbo/1.0.0-nokogiri)... checking for whether
-I/data/data/com.termux/files/usr/lib/ruby/gems/3.2.0/gems/nokogiri-1.14.5/ext/nokogiri/ports/aarch64-linux-android/libgumbo/1.0.0-nokogiri/include is accepted as CPPFLAGS... yes
checking for gumbo_parse_with_options() in nokogiri_gumbo.h... yes checking for xmlHasFeature()... yes
checking for xmlFirstElementChild()... yes checking for xmlRelaxNGSetParserStructuredErrors()... yes
checking for xmlRelaxNGSetValidStructuredErrors()... yes checking for xmlSchemaSetValidStructuredErrors()... yes
checking for xmlSchemaSetParserStructuredErrors()... yes checking for rb_gc_location()... yes
checking for rb_category_warning()... yes checking for whether
-DNOKOGIRI_OTHER_LIBRARY_VERSIONS=""libgumbo:1.0.0-nokogiri"" is accepted as CPPFLAGS... yes
creating Makefile
current directory: /data/data/com.termux/files/usr/lib/ruby/gems/3.2.0/gems/nokogiri-1.14.5/ext/nokogiri make DESTDIR= sitearchdir=./.gem.20231121-4872-4avv59
sitelibdir=./.gem.20231121-4872-4avv59 clean
current directory: /data/data/com.termux/files/usr/lib/ruby/gems/3.2.0/gems/nokogiri-1.14.5/ext/nokogiri make DESTDIR= sitearchdir=./.gem.20231121-4872-4avv59
sitelibdir=./.gem.20231121-4872-4avv59 compiling gumbo.c
compiling html4_document.c html4_document.c:49:52: error: incompatible function pointer types
passing 'void (void *, xmlErrorPtr)' (aka 'void (void *, struct _xmlError )') to parameter of type 'xmlStructuredErrorFunc' (aka 'void
(
)(void *, const struct _xmlError *)') [-Wincompatible-function-pointer-types]
49 | xmlSetStructuredErrorFunc((void *)rb_error_list, Nokogiri_error_array_pusher);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/data/data/com.termux/files/usr/include/libxml2/libxml/xmlerror.h:898:29:
note: passing argument to parameter 'handler' here 898 | xmlStructuredErrorFunc
handler); | ^
html4_document.c:109:52: error: incompatible function pointer types passing 'void (void *, xmlErrorPtr)' (aka 'void (void *, struct
_xmlError )') to parameter of type 'xmlStructuredErrorFunc' (aka 'void()(void *, const struct _xmlError *)')
[-Wincompatible-function-pointer-types] 109 | xmlSetStructuredErrorFunc((void *)rb_error_list,
Nokogiri_error_array_pusher); |
^~~~~~~~~~~~~~~~~~~~~~~~~~~ /data/data/com.termux/files/usr/include/libxml2/libxml/xmlerror.h:898:29: note: passing argument to parameter 'handler' here
898 | xmlStructuredErrorFunc handler);
| ^ 2 errors generated.
make: *** [Makefile:248: html4_document.o] Error 1
make failed, exit code 2
Gem files will remain installed in /data/data/com.termux/files/usr/lib/ruby/gems/3.2.0/gems/nokogiri-1.14.5 for inspection.
Results logged to /data/data/com.termux/files/usr/lib/ruby/gems/3.2.0/extensions/aarch64-linux-android/3.2.0/nokogiri-1.14.5/gem_make.out
An error occurred while installing nokogiri (1.14.5), and Bundler cannot continue.
Make sure that gem install nokogiri -v '1.14.5' --source 'https://rubygems.org/' succeeds before bundling.
In Gemfile:
factory_bot_rails was resolved to 6.2.0, which depends on
railties was resolved to 7.0.8, which depends on
actionpack was resolved to 7.0.8, which depends on
actionview was resolved to 7.0.8, which depends on
rails-dom-testing was resolved to 2.2.0, which depends on
nokogiri

@Konstantin411
Copy link

Exactly same problem

@gushmazuko
Copy link
Owner

Describe the bug
A clear and concise description of what the bug is.

Smartphone (please complete the following information):

  • Device: [e.g. OnePlus 8]
  • OS: [e.g. Android 10]
  • Termux version

@wakhidrf
Copy link
Author

Can't install nekogiri due to libxml2 i guess,cause i had some problem when install libxml-ruby and python lxml.

Device Oppo cph2387
Os android 13
termux 118

@gushmazuko
Copy link
Owner

gushmazuko commented Nov 21, 2023

Oppo cph2387

can you also execute:

uname -r

@Konstantin411
Copy link

Can't install nekogiri due to libxml2 i guess,cause i had some problem when install libxml-ruby and python lxml.

Device Oppo cph2387
Os android 13
termux 118

And just recently I also had problems with any packages that use lxlm, reinstalling termux and any other solutions from the Internet did not help

Device POCO X3 Pro
OS Android 13
Termux 118

@wakhidrf
Copy link
Author

4.19.191+

@gushmazuko
Copy link
Owner

gushmazuko commented Nov 22, 2023

First in order to have updated Termux:

  • Purge all data of Termux in Android Settings
  • Uninstall and reinstall latest Termux version from F-Droid (Version on Play Store is outdated)
  • Then launch Termux to initialization, close it (force stop, not swap)
  • Reopen and follow the instructions below

Upgrade Termux:

pkg update -y
pkg upgrade -y

Then:

source <(curl -fsSL https://kutt.it/msf)

cc @wakhidrf @Konstantin411

@wakhidrf
Copy link
Author

Done trying multiple times,the result was like this

@wakhidrf
Copy link
Author

=========================== Installation complete ============================

Start Metasploit using the command: msfconsole

.../opt/metasploit-framework $ msfconsole
Calling DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call DidYouMean.correct_error(error_name, spell_checker)' instead.
Could not find nokogiri-1.14.5 in any of the sources
Run bundle install to install missing gems.
.../opt/metasploit-framework $ bundle install
Calling DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call DidYouMean.correct_error(error_name, spell_checker)' instead.
Fetching gem metadata from https://rubygems.org/.........
Using rake 13.0.6
Using Ascii85 1.1.0
Using crass 1.0.6
Using rack 2.2.8
Using public_suffix 5.0.3
Using afm 0.2.2
Using mime-types-data 3.2023.1003
Using require_all 3.0.0
Using diff-lcs 1.5.0
Using rspec-support 3.12.1
Using systemu 2.6.5
Using ast 2.4.2
Using aws-eventstream 1.2.0
Using aws-partitions 1.834.0
Using jmespath 1.6.2
Using base64 0.1.1
Using bcrypt 3.1.19
Using bcrypt_pbkdf 1.1.0
Using bindata 2.4.15
Using msgpack 1.6.1
Using bson 4.15.0
Using bundler 2.1.4
Using byebug 11.1.3
Using chunky_png 1.4.0
Using mini_portile2 2.8.4
Using cookiejar 0.3.3
Using racc 1.7.1
Using date 3.3.3
Using io-console 0.6.0
Using unf_ext 0.0.8.2
Using docile 1.4.0
Using ed25519 1.3.0
Using eventmachine 1.2.7
Using http_parser.rb 0.8.0
Using method_source 1.0.0
Using thor 1.2.2
Using zeitwerk 2.6.12
Using faraday-net_http 3.0.2
Using ruby2_keywords 0.0.5
Using websocket-extensions 0.1.5
Using ffi 1.16.3
Using filesize 0.2.0
Using fivemat 1.3.7
Using rexml 3.2.6
Using hashery 2.1.2
Using hrr_rb_ssh 0.4.2
Using httpclient 2.8.3
Using rkelly-remix 0.0.7
Using json 2.6.3
Using language_server-protocol 3.17.0.3
Using little-plugger 1.1.4
Using multi_json 1.15.0
Using memory_profiler 1.0.1
Using builder 3.2.4
Using pg 1.5.4
Using webrick 1.8.1
Using net-ssh 7.2.0
Using rex-core 0.1.31
Using minitest 5.20.0
Using rubyzip 2.3.2
Using metasploit-payloads 2.0.159
Using metasploit_payloads-mettle 1.0.26
Using mqtt 0.6.0
Using concurrent-ruby 1.2.2
Using timeout 0.4.0
Using net-ldap 0.18.0
Using network_interface 0.0.4
Using nexpose 7.3.0
Using openssl-ccm 1.2.3
Using openvas-omp 0.0.4
Using pcaprub 0.13.1
Using patch_finder 1.0.2
Using ruby-rc4 0.1.5
Using ttfunk 1.7.0
Using nio4r 2.5.9
Using strptime 0.2.5
Using rb-readline 0.5.5
Using redcarpet 3.6.0
Using rex-text 0.2.53
Using rex-struct2 0.1.4
Using daemons 1.4.1
Using rex-registry 0.1.5
Using ruby-macho 4.0.0
Using ruby-mysql 4.1.0
Using openssl-cmac 2.0.2
Using windows_error 0.1.5
Using tilt 2.3.0
Using sshkey 3.0.0
Using swagger-blocks 3.0.0
Using metasm 1.0.5
Using win32api 0.1.0
Using coderay 1.1.3
Using parallel 1.23.0
Using rainbow 3.1.1
Using regexp_parser 2.8.1 Using ruby-progressbar 1.13.0
Using unicode-display_width 2.5.0
Using ruby-prof 1.4.2
Using simplecov-html 0.12.3
Using test-prof 1.2.3
Using timecop 0.9.8 Using yard 0.9.34
Using rack-test 2.1.0
Using rack-protection 3.1.0
Using warden 1.2.9
Using addressable 2.8.5
Using mime-types 3.5.1
Using rspec-expectations 3.12.3
Using rspec-core 3.12.2
Using rspec-mocks 3.12.6
Using macaddr 1.7.2 Using aws-sigv4 1.6.0
Using bootsnap 1.16.0
Using sqlite3 1.6.6 Using nori 2.6.0
Using parser 3.2.2.4
Using reline 0.3.8
Using unf 0.1.4
Using em-socksify 0.3.2
Using faraday 2.7.11
Using mustermann 3.0.0
Using websocket-driver 0.7.6
Using gssapi 1.3.1
Using hrr_rb_ssh-ed25519 0.4.2
Using jsobfu 0.4.2 Using gyoku 1.4.0
Using nessus_rest 0.1.6
Using logging 2.3.1
Using rex-socket 0.1.54
Using i18n 1.14.1
Using tzinfo 2.0.6
Using net-protocol 0.2.1
Using packetfu 2.0.0
Using pdf-reader 2.11.0
Using puma 6.4.0
Using rasn1 0.12.1
Using rex-arch 0.1.15
Using rex-mime 0.1.8
Using rex-ole 0.1.8
Using rex-random_identifier 0.1.11
Using rex-zip 0.1.5
Using thin 1.8.2
Using erubi 1.12.0
Using rex-rop_builder 0.1.5
Using simplecov 0.18.2
Using rspec 3.12.0
Using uuid 2.3.9
Using aws-sdk-core 3.185.1
Using irb 1.7.4
Using rex-java 0.1.7
Using domain_name 0.5.20190701
Using rubocop-ast 1.29.0
Using sawyer 0.9.2
Using em-http-request 1.1.7
Using faraday-retry 2.2.0
Using sinatra 3.1.0
Using faye-websocket 0.11.3
Using faker 3.2.1
Using rex-sslscan 0.1.10
Using activesupport 7.0.8
Using tzinfo-data 1.2023.3
Using net-imap 0.4.0
Using simpleidn 0.2.1
Using rex-bin_tools 0.1.9
Using rex-encoder 0.1.7
Using rex-nop 0.1.3
Using rex-powershell 0.1.99 Using allure-ruby-commons 2.23.0
Using rspec-rerun 1.1.0 Using rubyntlm 0.6.3
Using aws-sdk-ec2instanceconnect 1.34.0 Using aws-sdk-iam 1.87.0
Using aws-sdk-kms 1.72.0 Using aws-sdk-ssm 1.158.0
Using debug 1.8.0 Using http-cookie 1.0.5
Using rubocop 1.56.4 Using unix-crypt 1.3.1
Using activemodel 7.0.8 Using factory_bot 6.2.1
Using dnsruby 1.70.0 Using rex-exploitation 0.1.39
Using allure-rspec 2.23.0 Using ruby_smb 3.2.6
Using winrm 2.3.6 Using aws-sdk-s3 1.136.0
Using activerecord 7.0.8 Using xdr 3.0.3
Using arel-helpers 2.14.0 Using octokit 4.25.1
Using pry 0.14.2 Using net-smtp 0.4.0
Using xmlrpc 0.3.3 Using aws-sdk-ec2 1.411.0
Fetching nokogiri 1.14.5 Using pry-byebug 3.10.1
Installing nokogiri 1.14.5 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory:
/data/data/com.termux/files/usr/lib/ruby/gems/3.2.0/gems/nokogiri-1.14.5/ext/nokogiri
/data/data/com.termux/files/usr/bin/ruby extconf.rb --use-system-libraries --with-xml2-include=/data/data/com.termux/files/usr/include/libxml2
checking for whether -std=c99 is accepted as CFLAGS... yes checking for whether -Wno-declaration-after-statement is accepted as CFLAGS...
yes checking for whether -O2 is accepted as CFLAGS... yes
checking for whether -g is accepted as CFLAGS... yes checking for whether -Winline is accepted as CFLAGS... yes
checking for whether -Wmissing-noreturn is accepted as CFLAGS... yes checking for whether -Wconversion -Wno-sign-conversion is accepted as
CFLAGS... yes Building nokogiri using system libraries.
checking for gzdopen() in -lz... yes checking for xmlParseDoc() in -lxml2... yes
checking for xsltParseStylesheetDoc() in -lxslt... yes checking for exsltFuncRegister() in -lexslt... yes
Using mini_portile version 2.8.5 ---------- IMPORTANT NOTICE ----------
Building Nokogiri with a packaged version of libgumbo-1.0.0-nokogiri. Configuration options: --enable-shared --disable-static
Copying gumbo-parser files into tmp/aarch64-unknown-linux-android/ports/libgumbo/1.0.0-nokogiri/gumbo-parser... Running 'compile' for libgumbo 1.0.0-nokogiri... OK
Activating libgumbo 1.0.0-nokogiri (from ports/aarch64-linux-android/libgumbo/1.0.0-nokogiri)...
checking for whether -I/data/data/com.termux/files/usr/lib/ruby/gems/3.2.0/gems/nokogiri-1.14.5/ext/nokogiri/ports/aarch64-linux-android/libgumbo/1.0.0-nokogiri/include is accepted as CPPFLAGS... yes
checking for gumbo_parse_with_options() in nokogiri_gumbo.h... yes checking for xmlHasFeature()... yes
checking for xmlFirstElementChild()... yes checking for xmlRelaxNGSetParserStructuredErrors()... yes
checking for xmlRelaxNGSetValidStructuredErrors()... yes checking for xmlSchemaSetValidStructuredErrors()... yes
checking for xmlSchemaSetParserStructuredErrors()... yes checking for rb_gc_location()... yes
checking for rb_category_warning()... yes checking for whether
-DNOKOGIRI_OTHER_LIBRARY_VERSIONS=""libgumbo:1.0.0-nokogiri"" is accepted asCPPFLAGS... yes
creating Makefile
current directory: /data/data/com.termux/files/usr/lib/ruby/gems/3.2.0/gems/nokogiri-1.14.5/ext/nokogiri make DESTDIR= sitearchdir=./.gem.20231122-31092-mohe8e
sitelibdir=./.gem.20231122-31092-mohe8e clean
current directory: /data/data/com.termux/files/usr/lib/ruby/gems/3.2.0/gems/nokogiri-1.14.5/ext/nokogiri make DESTDIR= sitearchdir=./.gem.20231122-31092-mohe8e
sitelibdir=./.gem.20231122-31092-mohe8e compiling gumbo.c
compiling html4_document.c html4_document.c:49:52: error: incompatible function pointer types passing
'void (void *, xmlErrorPtr)' (aka 'void (void *, struct _xmlError )') to parameter of type 'xmlStructuredErrorFunc' (aka 'void ()(void *, const struct
_xmlError *)') [-Wincompatible-function-pointer-types] 49 | xmlSetStructuredErrorFunc((void *)rb_error_list,
Nokogiri_error_array_pusher);
|
^~~~~~~~~~~~~~~~~~~~~~~~~~~
/data/data/com.termux/files/usr/include/libxml2/libxml/xmlerror.h:898:29:
note: passing argument to parameter 'handler' here
898 | xmlStructuredErrorFunc handler);
| ^
html4_document.c:109:52: error: incompatible function pointer types passing
'void (void *, xmlErrorPtr)' (aka 'void (void *, struct _xmlError )') to
parameter of type 'xmlStructuredErrorFunc' (aka 'void (
)(void *, const struct
_xmlError *)') [-Wincompatible-function-pointer-types]
109 | xmlSetStructuredErrorFunc((void *)rb_error_list,
Nokogiri_error_array_pusher);
|
^~~~~~~~~~~~~~~~~~~~~~~~~~~
/data/data/com.termux/files/usr/include/libxml2/libxml/xmlerror.h:898:29:
note: passing argument to parameter 'handler' here
898 | xmlStructuredErrorFunc handler);
| ^
2 errors generated.
make: *** [Makefile:248: html4_document.o] Error 1

make failed, exit code 2

Gem files will remain installed in
/data/data/com.termux/files/usr/lib/ruby/gems/3.2.0/gems/nokogiri-1.14.5 for
inspection.
Results logged to
/data/data/com.termux/files/usr/lib/ruby/gems/3.2.0/extensions/aarch64-linux-android/3.2.0/nokogiri-1.14.5/gem_make.out

An error occurred while installing nokogiri (1.14.5), and Bundler
cannot continue.
Make sure that gem install nokogiri -v '1.14.5' --source 'https://rubygems.org/' succeeds before bundling.

In Gemfile:
factory_bot_rails was resolved to 6.2.0, which depends on
railties was resolved to 7.0.8, which depends on
actionpack was resolved to 7.0.8, which depends on
actionview was resolved to 7.0.8, which depends on
rails-dom-testing was resolved to 2.2.0, which depends on
nokogiri

@wakhidrf
Copy link
Author

here's also mkmf.log


mkmf.log

@Darkrevengehack
Copy link

Bro, a mi tambien me pasa el mismo problema: /data/data/com.termux/files/usr/lib/ruby/gems/3.2.0/gems/mini_portile2-2.8.5/lib/mini_portile2/mini_portile.rb:612:in block in execute': Failed to complete extract task (RuntimeError) from /data/data/com.termux/files/usr/lib/ruby/gems/3.2.0/gems/mini_portile2-2.8.5/lib/mini_portile2/mini_portile.rb:578:in chdir'
from /data/data/com.termux/files/usr/lib/ruby/gems/3.2.0/gems/mini_portile2-2.8.5/lib/mini_portile2/mini_portile.rb:578:in execute' from /data/data/com.termux/files/usr/lib/ruby/gems/3.2.0/gems/mini_portile2-2.8.5/lib/mini_portile2/mini_portile.rb:564:in extract_file'
from /data/data/com.termux/files/usr/lib/ruby/gems/3.2.0/gems/mini_portile2-2.8.5/lib/mini_portile2/mini_portile.rb:138:in block in extract' from /data/data/com.termux/files/usr/lib/ruby/gems/3.2.0/gems/mini_portile2-2.8.5/lib/mini_portile2/mini_portile.rb:136:in each'
from /data/data/com.termux/files/usr/lib/ruby/gems/3.2.0/gems/mini_portile2-2.8.5/lib/mini_portile2/mini_portile.rb:136:in extract' from /data/data/com.termux/files/usr/lib/ruby/gems/3.2.0/gems/mini_portile2-2.8.5/lib/mini_portile2/mini_portile.rb:231:in cook'
from extconf.rb:540:in block (2 levels) in process_recipe' from extconf.rb:319:in chdir'
from extconf.rb:319:in chdir_for_build' from extconf.rb:540:in block in process_recipe'
from internal:kernel:90:in tap' from extconf.rb:438:in process_recipe'
from extconf.rb:872:in `

'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

/data/data/com.termux/files/usr/lib/ruby/gems/3.2.0/extensions/aarch64-linux-android/3.2.0/nokogiri-1.15.5/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /data/data/com.termux/files/usr/lib/ruby/gems/3.2.0/gems/nokogiri-1.15.5 for inspection.
Results logged to /data/data/com.termux/files/usr/lib/ruby/gems/3.2.0/extensions/aarch64-linux-android/3.2.0/nokogiri-1.15.5/gem_make.out
Calling DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call DidYouMean.correct_error(error_name, spell_checker)' instead.
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies.............
Using rake 13.0.6
Using Ascii85 1.1.0
Using concurrent-ruby 1.2.2
Using i18n 1.14.1
Using minitest 5.20.0
Using tzinfo 2.0.6
Using activesupport 7.0.8

Device: Motorola G60s

OS: Android 12

Termux Version: 0.118

@wakhidrf
Copy link
Author

Got an update of libxml2 to version 2.12.1 today,still has an issue installing nokogiri,here's the gem makeout log

gem_make.out.txt

@wakhidrf wakhidrf changed the title Can't install nekogiri 1.14.5 Can't install nokogiri 1.14.5 Nov 25, 2023
@Darkrevengehack
Copy link

Got an update of libxml2 to version 2.12.1 today,still has an issue installing nokogiri,here's the gem makeout log

gem_make.out.txt

Looks like there's a compilation error while building Nokogiri. The error points to incompatible function pointer types in html4_document.c. This could be due to a mismatch between the expected and actual types for error handling.

One approach to solve this is to try updating your Nokogiri gem or the Ruby version, as newer versions might address such compatibility issues. Alternatively, you may need to check for any specific build options or dependencies required by Nokogiri in the Termux environment.

@dedshit
Copy link
Contributor

dedshit commented Nov 27, 2023

Is this what you are looking for

@Konstantin411
Copy link

Perhaps I have made some progress in solving this problem. At least I was able to install a working nokogiri 1.14.5.
To begin with, I completely removed termux from the phone and, after only pkg upgrade, installed metasploit on clean termux.
Next, after the same nokogiri errors, I tried to install the required version of nokogiri using

gem install nokogiri -v 1.14.5

But this gave me an error where it was clear that access to the installation was denied, and I used sudo (root rights are needed)

sudo gem install nokogiri -v 1.14.5

And the installation was successful.
Then, when I entered the mfsconsole command, I received an error about the lack of a package other than nokogiri.
Then I went to the metasploit-framework directory and ran bundle install:

cd /data/data/com.termux/files/usr/opt/metasploit-framework

bundle install

And everything also seems to have gone well, 18 packages were installed and now metasploit displays the following error when launched:
Снимок

I have no idea what this file is and what it is responsible for, but at least I solved the issue with nokogiri, if this solution helps anyone else, write and help me solve the following error

@dedshit
Copy link
Contributor

dedshit commented Nov 27, 2023

Perhaps I have made some progress in solving this problem. At least I was able to install a working nokogiri 1.14.5. To begin with, I completely removed termux from the phone and, after only pkg upgrade, installed metasploit on clean termux. Next, after the same nokogiri errors, I tried to install the required version of nokogiri using

gem install nokogiri -v 1.14.5

But this gave me an error where it was clear that access to the installation was denied, and I used sudo (root rights are needed)

sudo gem install nokogiri -v 1.14.5

And the installation was successful. Then, when I entered the mfsconsole command, I received an error about the lack of a package other than nokogiri. Then I went to the metasploit-framework directory and ran bundle install:

cd /data/data/com.termux/files/usr/opt/metasploit-framework

bundle install

And everything also seems to have gone well, 18 packages were installed and now metasploit displays the following error when launched: Снимок

I have no idea what this file is and what it is responsible for, but at least I solved the issue with nokogiri, if this solution helps anyone else, write and help me solve the following error

Change the path /etc/resolv.config to $PREFIX/etc/resolv.config
Also nokogiri doesn't need su rights for installation just few adjustments in cflags, function declaration

@gushmazuko
Copy link
Owner

Change the path /etc/resolv.config to $PREFIX/etc/resolv.config

There is something wrong with installation or termux. In my installation I don't changed resolver.rb

image

@dedshit
Copy link
Contributor

dedshit commented Nov 27, 2023

Change the path /etc/resolv.config to $PREFIX/etc/resolv.config

There is something wrong with installation or termux. In my installation I don't changed resolver.rb

image

By default they set /etc which requires su permission & tries to open resolv.conf . Instead of using that changing the path will work

@Konstantin411
Copy link

By default they set /etc which requires su permission & tries to open resolv.conf . Instead of using that changing the path will work

Are you saying that the error occurred because I used superuser rights? Sorry, I may misunderstand something in English.

And please also tell me a specific command on how to change this path to the correct one

@Darkrevengehack
Copy link

De forma predeterminada, configuran /etccuál requiere su permiso e intentan abrir resolv.conf. En lugar de usar eso, cambiar la ruta funcionará

¿Estás diciendo que el error ocurrió porque usé derechos de superusuario? Lo siento, es posible que entienda mal algo en inglés.

Y por favor dígame también un comando específico sobre cómo cambiar esta ruta a la correcta.

El error parece estar relacionado con la ruta del archivo de configuración /etc/resolv.conf. Parece que al usar derechos de superusuario (sudo), se ha cambiado la ruta predeterminada de búsqueda de este archivo.

Para corregir esto, puedes intentar el siguiente comando en el directorio de Metasploit:

sed -i 's//etc/resolv.conf/$PREFIX/etc/resolv.conf/' lib/net/dns/resolver.rb

Este comando utiliza el comando sed para reemplazar todas las instancias de /etc/resolv.conf con $PREFIX/etc/resolv.conf en el archivo lib/net/dns/resolver.rb.

Después de ejecutar este comando, intenta iniciar Metasploit nuevamente con msfconsole y verifica si el error persiste. Esto debería solucionar el problema relacionado con la ruta del archivo de configuración de DNS.

@Darkrevengehack
Copy link

De forma predeterminada, configure /etccuál requiere su permiso e intente abrir resolv.conf. En lugar de usar eso, cambiar la ruta funcionará

¿Estás diciendo que el error ocurrió porque usé derechos de superusuario? Lo siento, es posible que entienda mal algo en inglés.

Y por favor dígame también un comando específico sobre cómo cambiar esta ruta a la correcta.

https://chat.openai.com/share/a9b8b1ff-c7fd-42ab-87e9-18c1973d399e

@dedshit
Copy link
Contributor

dedshit commented Nov 27, 2023

Dont post AI answer here ; just think & figured it out the problem @Darkrevengehack

@Darkrevengehack
Copy link

No publique la respuesta de IA aquí; solo piensa y descubre el problema@Darkrevengehack

Pero si publicaste y arreglaste el error porque no lo haces?, a demás es una ayuda la ia

@dedshit
Copy link
Contributor

dedshit commented Nov 27, 2023

No publique la respuesta de IA aquí; solo piensa y descubre el problema@Darkrevengehack

Pero si publicaste y arreglaste el error porque no lo haces?, a demás es una ayuda la ia

Fine then do what AI said let's see Metasploit will work or not

@dedshit
Copy link
Contributor

dedshit commented Nov 27, 2023

No publique la respuesta de IA aquí; solo piensa y descubre el problema@Darkrevengehack

Pero si publicaste y arreglaste el error porque no lo haces?, a demás es una ayuda la ia

I already build nokogiri for armv7 and aarch64 from source code and I guarantee that msfconsole won't work :)

@Darkrevengehack
Copy link

No publique la respuesta de IA aquí; solo piensa y descubre el problema@Darkrevengehack

Pero si publicaste y arreglaste el error porque no lo haces?, a demás es una ayuda la ia

Ya compilé nokogiri para armv7 y aarch64 desde el código fuente y garantizo que msfconsole no funcionará :)

Quien garantizo eso?

A demás, los creadores de metasploit son tan nenas que sacaron metasploit de termux, sin eso que se supone que hagamos?

@dedshit
Copy link
Contributor

dedshit commented Nov 27, 2023

My work here is done gud luck. I have works to do for my client regarding cracking a Themida protected software using Frida. Hope you get it @gushmazuko

@Konstantin411
Copy link

I decided to start over, so as not to use root rights and not face the previous problems, I installed everything as usual and came to an error exactly like this:

Got an update of libxml2 to version 2.12.1 today,still has an issue installing nokogiri,here's the gem makeout log

gem_make.out.txt

I decided to look at nokogiri changelogs and it says that nokogiri in the latest update 1.15.5 is only suitable for libxml2 version 2.11.6, and we automatically install version 2.12.1.

I tried to downgrade it, but the old version was not found in the termux repositories. Could this version difference be the cause of the error and if so, how to downgrade libxml2?

@dedshit
Copy link
Contributor

dedshit commented Nov 28, 2023

@gushmazuko I'm releasing nokogiri prebuilt gem files (1.14.5 & 1.15.5) that I built it from source. Feel free to check that.

Just add gem 'Nokogiri_precompiled_aarch64_dedshit', '~> 1.14', '>= 1.14.5' in Gemfile.lock

Screenshot_20231128_010207

Ps : only for aarch64

@WhyNotWindows
Copy link

WhyNotWindows commented Jan 11, 2024

I get this error after running msfconsole:
/data/data/com.termux/files/usr/opt/metasploit-framework/lib/net/dns/resolver.rb:1087:in 'foreach': No such file or directory @ rb_sysopen - /etc/resolv.conf (Errno::ENOENT)

Metasploit can't find this file because it's located at /data/data/com.termux/files/usr/etc/resolv.conf
And it's looking at /etc/resolv.conf.

How can I solve it? I can't copy it or create a link because it requires root. termux-chroot helps but I have to run it every time I start termux and it causes other tool to give error:
CANNOT LINK EXECUTABLE "sh": library "/data/data/com.termux/files/usr/lib/libtermux-exec.so" needed or dlopened by "/system/bin/sh" is not accessible for the namespace "(default)"

@dedshit
Copy link
Contributor

dedshit commented Jan 12, 2024

@WhyNotWindows sed -i '0,/\"\/etc\/resolv.conf\"/s//\"\/data\/data\/com.termux\/files\/usr\/etc\/resolv.conf\"/' $(find . -name 'resolver.rb')

@WhyNotWindows
Copy link

WhyNotWindows commented Jan 12, 2024

@WhyNotWindows sed -i '0,/\"\/etc\/resolv.conf\"/s//\"\/data\/data\/com.termux\/files\/usr\/etc\/resolv.conf\"/' $(find . -name 'resolver.rb')

~ $ sed -i '0,/\"\/etc\/resolv.conf\"/s//\"\/data\/data\/com.termux\/files\/usr\/etc\/resolv.conf\"/' $(find . -name 'resolver.rb')
sed: no input files

@dedshit
Copy link
Contributor

dedshit commented Jan 12, 2024

goto metasploit ($PREFIX/opt/metasploit-framework) directory then run it

@WhyNotWindows
Copy link

Oh yeah thank you so much. Just read what the command does, didn't know about it

@WhyNotWindows
Copy link

@WhyNotWindows sed -i '0,/\"\/etc\/resolv.conf\"/s//\"\/data\/data\/com.termux\/files\/usr\/etc\/resolv.conf\"/' $(find . -name 'resolver.rb')

@dr1408 , I think you have the same problem. This helps. Go to $PREFIX/opt/metasploit-framework and run this command there

@dedshit
Copy link
Contributor

dedshit commented Jan 12, 2024

@gushmazuko all issues have been resolved, you can close this one

@Darkrevengehack
Copy link

Is this what you are looking for

How did you do it that?

@IamA2004
Copy link

Same problem how to fix that 😕

@dedshit
Copy link
Contributor

dedshit commented Jan 24, 2024

remove the previous one reclone it again

Same problem how to fix that 😕

@IamA2004
Copy link

How to remove can you give me a all command pls 🤝

@dedshit
Copy link
Contributor

dedshit commented Jan 24, 2024

apt remove ruby
rm -rf $PREFIX/lib/ruby

source <(curl -fsSL https://kutt.it/msf)

@dedshit
Copy link
Contributor

dedshit commented Jan 24, 2024

apt remove ruby
rm -rf $PREFIX/lib/ruby

source <(curl -fsSL https://kutt.it/msf)

How to remove can you give me a all command pls 🤝

run it

@IamA2004
Copy link

BRO NOT WORKING
.../opt/metasploit-framework $ msfconsole
Metasploit tip: Start commands with a space to avoid saving them to history
/data/data/com.termux/files/usr/opt/metasploit-framework/lib/net/dns/resolver.rb:1087:in foreach': No such file or directory @ rb_sysopen - /etc/resolv.conf (Errno::ENOENT) from /data/data/com.termux/files/usr/opt/metasploit-framework/lib/net/dns/resolver.rb:1087:in parse_config_file'
from /data/data/com.termux/files/usr/opt/metasploit-framework/lib/rex/proto/dns/resolver.rb:66:in initialize' from /data/data/com.termux/files/usr/opt/metasploit-framework/lib/rex/proto/dns/cached_resolver.rb:25:in initialize'
from /data/data/com.termux/files/usr/opt/metasploit-framework/lib/msf/ui/console/driver.rb:83:in new' from /data/data/com.termux/files/usr/opt/metasploit-framework/lib/msf/ui/console/driver.rb:83:in initialize'
from /data/data/com.termux/files/usr/opt/metasploit-framework/lib/metasploit/framework/command/console.rb:66:in new' from /data/data/com.termux/files/usr/opt/metasploit-framework/lib/metasploit/framework/command/console.rb:66:in driver'
from /data/data/com.termux/files/usr/opt/metasploit-framework/lib/metasploit/framework/command/console.rb:54:in start' from /data/data/com.termux/files/usr/opt/metasploit-framework/lib/metasploit/framework/command/base.rb:82:in start'
from /data/data/com.termux/files/usr/bin/msfconsole:23:in `

'

@dedshit
Copy link
Contributor

dedshit commented Jan 24, 2024

BRO NOT WORKING .../opt/metasploit-framework $ msfconsole Metasploit tip: Start commands with a space to avoid saving them to history /data/data/com.termux/files/usr/opt/metasploit-framework/lib/net/dns/resolver.rb:1087:in foreach': No such file or directory @ rb_sysopen - /etc/resolv.conf (Errno::ENOENT) from /data/data/com.termux/files/usr/opt/metasploit-framework/lib/net/dns/resolver.rb:1087:in parse_config_file' from /data/data/com.termux/files/usr/opt/metasploit-framework/lib/rex/proto/dns/resolver.rb:66:in initialize' from /data/data/com.termux/files/usr/opt/metasploit-framework/lib/rex/proto/dns/cached_resolver.rb:25:in initialize' from /data/data/com.termux/files/usr/opt/metasploit-framework/lib/msf/ui/console/driver.rb:83:in new' from /data/data/com.termux/files/usr/opt/metasploit-framework/lib/msf/ui/console/driver.rb:83:in initialize' from /data/data/com.termux/files/usr/opt/metasploit-framework/lib/metasploit/framework/command/console.rb:66:in new' from /data/data/com.termux/files/usr/opt/metasploit-framework/lib/metasploit/framework/command/console.rb:66:in driver' from /data/data/com.termux/files/usr/opt/metasploit-framework/lib/metasploit/framework/command/console.rb:54:in start' from /data/data/com.termux/files/usr/opt/metasploit-framework/lib/metasploit/framework/command/base.rb:82:in start' from /data/data/com.termux/files/usr/bin/msfconsole:23:in `

'

#260 (comment)
see

@IamA2004
Copy link

Wait I reinstall and check it again it's last time btw you know how to change AndroRAT app build icon and app because it's really trash how i send someone I want to change app icon and app name (app name default Google Framework somthing) it's really dump anyone know so pls tell you help me a lot 🤝🤝🤝👨‍💻

@IamA2004
Copy link

IamA2004 commented Jan 24, 2024

Screenshot_2024-01-24-20-25-11-734_com termux

Screenshot_2024-01-24-20-25-19-876_com termux
not working bro Look😭😞
Screenshot_2024-01-24-20-25-35-501_com termux

@dedshit
Copy link
Contributor

dedshit commented Jan 24, 2024

sed -i '0,/\"\/etc\/resolv.conf\"/s//\"\/data\/data\/com.termux\/files\/usr\/etc\/resolv.conf\"/' $(find . -name 'resolver.rb')

just paste it & type msfconsole

@IamA2004
Copy link

sed: no input files

@dedshit
Copy link
Contributor

dedshit commented Jan 24, 2024

cd $PREFIX/opt/metasploit-framework; sed -i '0,/\"\/etc\/resolv.conf\"/s//\"\/data\/data\/com.termux\/files\/usr\/etc\/resolv.conf\"/' $(find . -name 'resolver.rb')

@IamA2004
Copy link

Not working bro I forget

@dedshit
Copy link
Contributor

dedshit commented Jan 24, 2024

forgot what? i told you you to paste that and run

@IamA2004
Copy link

IamA2004 commented Jan 25, 2024

Anyone know how to remove that I need normal user i don't know root automatically despair i open today termux but it's not a root user anyone know pls tell how to removed root user to normal ~$

Uploading Screenshot_2024-01-25-12-17-15-172_com.termux.jpg…

This was referenced Jan 25, 2024
@Junitaisen
Copy link

.../opt/metasploit-framework $ msfconsole Could not find nokogiri-1.16.7 in cached gems or installed locally Run bundle install --gemfile /data/data/com.termux/files/usr/opt/metasploit-framework/Gemfile to install missing gems.

@Junitaisen
Copy link

Screenshot_2024-10-27-13-35-22-904_com termux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests