Guest User

Untitled

a guest
Oct 15th, 2014
333
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.34 KB | None | 0 0
  1. #amodule.rb
  2. #!/usr/bin/ruby
  3.  
  4. module RubyModule
  5.   def do_something
  6.     #do nothing
  7.   end
  8. end
  9.  
  10.  
  11. #main.rb
  12. #!/usr/bin/ruby
  13.  
  14. require './amodule.rb'
  15.  
  16. RubyModule.do_something
  17.  
  18.  
  19.  
  20.  
  21. #When I run "ruby main.rb", I get the following error:
  22. #main.rb:5:in `<main>': undefined local variable or method `do_something' for main:Object (NameError)
Advertisement
Add Comment
Please, Sign In to add comment