Why i cant install metasploit on termux with out root it always says like this - metasploit

Traceback (most recent call last):
ruby: No such file or directory -- /data/data/com.termux/files/home/metasploit-framework/msfconsole (LoadError)

Related

Can't resolve the load error for telegram bot

i've followed https://www.process.st/telegram-bot/ steps for creating a telegram bot. an absolute beginner to coding and i can't seem to get my bot to respond at all even after renaming the file.
Traceback (most recent call last):
2: from bot.rb:1:in `<main>'
1: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- telegramtest_bot (LoadError)```
Looking over the tutorial, it looks like the gem is "telegram_bot" and not "telegramtest_bot". Gem requirees are exact wording.
e.g. require "nokogiri"
Additionally, you can version the gem in your gemfile.
This post seems to be a good overview of how "require" works: https://www.educba.com/ruby-require/
You can try the following in order to resolve it (for windows users):
Navigate to your telegram bot folder
Install bundle
run ruby bot.rb
Worked for me when i did that!

Why does the roc gem generate an error when I do `require 'roc'`

Learning to use the roc gem, I run a simple program below and keep getting errors. Pretty sure my Ruby and gem versions are up to date. Can't see what I'm doing wrong.
The error:
Traceback (most recent call last): 2: from PDaucT.rb:2:in ''
1: from
/Users/royxxxxxx/.rvm/rubies/ruby-2.6.5/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in 'require'
/Users/royxxxxx/.rvm/rubies/ruby-2.6.5/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in 'require': cannot load such file -- roc (LoadError)
My code:
require 'matrix'
require 'roc'
aucdata = Matrix[ [0.9, 1], [0.8, 1] ]
print "Test of basic code"
puts

How to use require if there is Cyrillic char in the path

I’m trying to build a cross-platform portable application with Ruby and there is a problem on Windows. When there is a Cyrillic character (maybe just not Latin) in the path require doesn’t work:
D:\users\киї\Ruby\2.6\bin>ruby -v
ruby 2.6.3p62 (2019-04-16 revision 67580) [x64-mingw32]
D:\users\киї\Ruby\2.6\bin>ruby -e "require 'logger'"
Traceback (most recent call last):
1: from <internal:gem_prelude>:2:in `<internal:gem_prelude>'
<internal:gem_prelude>:2:in `require': No such file or directory -- D:/users/РєРёС—/Ruby/2.6/lib/ruby/2.6.0/rubygems.rb (LoadError)
D:\users\киї\Ruby\2.6\bin>ruby --disable=rubyopt -e "require 'logger'"
Traceback (most recent call last):
1: from <internal:gem_prelude>:2:in `<internal:gem_prelude>'
<internal:gem_prelude>:2:in `require': No such file or directory -- D:/users/РєРёС—/Ruby/2.6/lib/ruby/2.6.0/rubygems.rb (LoadError)
D:\users\киї\Ruby\2.6\bin>gem list
Traceback (most recent call last):
1: from <internal:gem_prelude>:2:in `<internal:gem_prelude>'
<internal:gem_prelude>:2:in `require': No such file or directory -- D:/users/РєРёС—/Ruby/2.6/lib/ruby/2.6.0/rubygems.rb (LoadError)
We can see such encoding transformations in the output:
РєРёС— -> киї
win1251 -> utf-8
I have an old Ruby installation that works fine:
D:\users\киї\Ruby\2.0\bin>ruby -e "require 'logger'"
D:\users\киї\Ruby\2.0\bin>ruby -v
ruby 2.0.0p451 (2014-02-24) [i386-mingw32]
The same is for ruby 2.0.0p643 (2015-02-25) [i386-mingw32].
I also checked that require fails in the same case for
ruby 2.1.9p490 (2016-03-30 revision 54437) [i386-mingw32]
Looks like there is an ugly workaround.
1) Ensure to do chcp 1251 in current console session.
2) Run Ruby with an option --disable=gems so it will not fail initially.
3) Add next code at the very beginning of a script:
if $:[0].encoding.name == 'Windows-1251'
$:.each {|path| path.encode! 'UTF-8' }
$:.push '.' # somehow it helps, looks like a modification of array is needed
require 'rubygems'
end
This helped me to overcome the problem and run my script from a folder with Cyrillic and spaces in the path.
But it definitely should be fixed.

Cannot run gem after updating

I'm running MacOS Mojave 10.14.4. I ran the command gem update and it seemed to run fine. (A lot was out of date.) However, since then, every gem command crashes like this:
$ gem --version
Traceback (most recent call last):
4: from <internal:gem_prelude>:2:in `<internal:gem_prelude>'
3: from <internal:gem_prelude>:2:in `require'
2: from /Users/tedhopp/.rvm/rubies/ruby-2.5.0/lib/ruby/site_ruby/2.5.0/rubygems.rb:1395:in `<top (required)>'
1: from /Users/tedhopp/.rvm/rubies/ruby-2.5.0/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
/Users/tedhopp/.rvm/rubies/ruby-2.5.0/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require': cannot load such file -- rubygems/core_ext/kernel_warn (LoadError)
I also ran brew update and brew upgrade and then rebooted my system, but that didn't help. Finally, I tried downloading and reinstalling rubygems from rubygems.org, but when I ran ruby setup.rb I still got the same error. How do I fix this?
Solved my own problem. I'm posting an answer rather than deleting the question in case it helps someone else.
It turns out that I was running an outdated version of Ruby. Once I ran the following:
> rvm get stable --autolibs=enable
> rvm default 2.6.3
all the problems went away.

create Scheduled Task from working Ruby script on Ubuntu inside Windows10

I have a Windows10 Ubuntu bash environment set up. It has a few rubygems installed (without docker, bundler, without rvm, and also this is not rails). The script is working fine when I run it manually from inside the Ubuntu terminal, in the user home folder ~/
Now my goal is create a Windows Scheduled Task using the Task Scheduler application, to run the script daily, like I would with a crontab in Unix.
The action in this Scheduled Task is the challenge. In testing manually from the Windows CMD prompt, I got as far as:
C:\>C:\Windows\System32\bash.exe -c "ruby ~/myscript.rb"
That fails :
Traceback (most recent call last):
2: from /home/lam/ruby/remind_prepare_dad_before_iterative_ends.rb:15:in `<main>'
1: from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
/usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require': cannot load such file -- tiny_tds (LoadError)
Above error tells me it cannot find my gem, TinyTDS. What do I add to the command line to make it find my gems?
I found a crude workaround for my own problem: just install the gem from the same command line:
C:\>C:\Windows\System32\bash.exe -c "sudo gem install tiny_tds"
I had to re-install a few more gems I use in the same way.
After this, I put in a -C argument to start ruby in the right directory, like so:
C:\>C:\Windows\System32\bash.exe -c "ruby -C ~/ruby myscript.rb"
works like a charm.
I suppose now I have duplicated gems floating in spaces on the machine, but we will address that issue if it ever becomes a problem. :-)
Try bundle exec ruby ~/myscript.rb

Resources