简体   繁体   中英

Executing a ruby script on Windows 7 command line with multiple ruby files required

This might be a trivial question, but I've searched and found nothing about it. I'm trying to make a complex application on ruby and I have my classes on different .rb files which the "Main" class requires. As it's written in the code:

require 'Book.rb'
require 'Person.rb'

These files that contains the classes are in the same directory, so what I'm looking for is a Batch command which allows me to include these files, like the one for one file but extended:

ruby Main.rb

Which, of course fails saying that it can't find 'Book.rb' (returns error and doesn't look for the other)

Thank you for your help.

Thanks to the user Abhi y found this post. The command that worked for me was:

irb -I . -r Main.rb

From which you can get further information on the link.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM