1

That title might sound ridiculous - to be more specific, I can get irb running but I cannot interpret Ruby files from the command prompt.

I tried using the "load" command. The shell couldn't find the filename:

> load("Scraper.rb")
LoadError: cannot load such file -- Scraper.rb
    from (irb):3:in 'load'
    from (irb):3
    from C:/Ruby200-x64/bin/irb:12:in '<main>'

Even giving the global path did not help. I also tried running these instructions to add the local directory to shell path, but they didn't work: Adding a directory to $LOAD_PATH (Ruby)

I also tried adding execution of .rb files with an rubyinstaller to the PATH. I followed these instructions, but they are too outdated: http://rubyonwindowsguides.github.io/book/ch02-01.html

Community
  • 1
  • 1
Whosyourjay
  • 154
  • 1
  • 8

1 Answers1

0

If you are able to run the IRB then you likely are able to run Ruby files as well.

You don't show how you are attempting to run the Ruby files, this information would be helpful in your question.

If you select "Prompt with Ruby" in your menu, you should be able to simply type ruby some_file.rb to run a Ruby file. You can also associate files by naming them "some_file.rbw" depending on if you want a terminal window so show or not. Hope this gets you at least a hint.

What you are showing here seems to be an IRB prompt, not a command prompt.

vgoff
  • 10,980
  • 3
  • 38
  • 56