我剛開始學習ruby。似乎默認的gem安裝路徑不是Ruby的一部分。這是正常的行爲嗎?我如何設置默認的紅寶石路徑?例如:OSX Ruby Gems添加到紅寶石路徑?
[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
正如你可以看到packetfu安裝在/Library/Ruby/Gems/1.8/gems/,但是Ruby不能找到它......
gem environment'命令是什麼打印出來的? – Brian 2010-10-06 18:01:40
在附註中,請查看「Ruby Version Manager」:http://rvm.beginrescueend.com/這會讓您的Ruby體驗變得更有趣,更輕鬆! – Himanshu 2010-10-07 01:06:49