OSX Ruby Gems Add to Ruby Path?

I'm just starting to study ruby. It seems that the default gems installation path is not part of Ruby. Is this normal behavior? How can I set the ruby ​​default path? Example:

[11:53:33]wuntee:/Library/Ruby/Gems/1.8/gems/packetfu-1.0.0/examples$ sudo ruby arphood.rb 
Fetching the oui.txt from IEEE, it'll be a second. Avoid this with arphood.rb <filename>.
arphood.rb:30:in `require': no such file to load -- packetfu (LoadError)
    from arphood.rb:30:in `arp_everyone'
    from arphood.rb:51

As you can see, packfu is installed in / Library / Ruby / Gems / 1.8 / gems /, but Ruby cannot find it ...

+3
source share
1 answer

because you are not in the directory where the packagefu.rb file is located, and there is no need for "rubygems" to add gem paths to your script

+4
source

Source: https://habr.com/ru/post/1768293/


All Articles