Ruby newbie here. I'm trying to use the Easyjour module ( http://easyjour.rubyforge.org/ ) from irb. After a gem install easyjour
this is what I get:
irb(main):002:0> service = Easyjour.serve("files", 'http', 3000)
NameError: uninitialized constant Easyjour
What am I missing here? Do I need to 开发者_运维问答import the module first somehow?
You need to first load the easyjour
library, before you can use any code from it:
require 'easyjour'
An alternative to Jorg's approach is to load the module at the command line when starting irb
:
irb -r easyjour
精彩评论