-1

I am trying to run a scraper/spider class locally, or on a server, but what's the correct command to launch it?

For example, if the spider's name is newyorkhomes.rb and has the following: module Spider module Feeds class NewYorkHomes < Spider::Feeds::Base

When I switch into the the directory containing the file, I tried to run the following: load 'newyorkhomes.rb' and ruby 'newyorkhomes.rb' but neither worked

bundle exec newyorkhomes.rb doesn't work either

should I execute it locally or on a server? I can change my directory into the file containing these scraper tasks on a server but the server doesn't support that many commands there

AlexWang
  • 369
  • 1
  • 4
  • 7
  • http://stackoverflow.com/questions/7958594/how-to-run-a-ruby-script-within-bundler-context from Dave Newton – Pinacolada May 10 '17 at 21:55

1 Answers1

0

No need for quotation marks. If I was in my ~/User/Desktop/ and wanted to run a file named foo.rb, I would simply run, ruby foo.rb.

Cheers.

Collin Graves
  • 2,207
  • 15
  • 11
  • I tried to execute it but then this is the message i received: pistilli.rb:3:in `': uninitialized constant Spider::Feeds::Base (NameError) from pistilli.rb:2:in `' from pistilli.rb:1:in `
    '
    – AlexWang May 28 '15 at 23:56