Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7829433
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T10:45:31+00:00 2026-06-02T10:45:31+00:00

Hell everyone. I need some help with a ruby script that I am writing

  • 0

Hell everyone. I need some help with a ruby script that I am writing that doesn’t seem to be working. Simply put, I am getting an error when using Rufus to schedule something to happen “at” a specific time.

Here is my code.

  starttime = Time.new + (60)
  scheduler = Rufus::Scheduler.start_new
  scheduler.at starttime do
    Curl::Easy.download(url, filename = "/tmp/test.xml")
  end

While that works, it errors out after it’s first run with the following:

================================================================================
scheduler caught exception:
can't convert nil into String
/Users/me/.gem/ruby/1.9.1/gems/curb-0.8.0/lib/curl/easy.rb:38:in `add'
/Users/me/.gem/ruby/1.9.1/gems/curb-0.8.0/lib/curl/easy.rb:38:in `perform'
/Users/me/.gem/ruby/1.9.1/gems/curb-0.8.0/lib/curl/easy.rb:358:in `download'
/Users/me/Dropbox/Files/Personal/RubyMine/hbo_hackathon/SOME:19:in `block (2 levels) in <top (required)>'

I am pretty new to Ruby (and development in general), so I am not sure why this is happening. Can someone help please?

Also, the real goal here is to replace this line:

starttime = Time.new + (60)

With this line:

starttime = REXML::XPath.first( doc, '/new/time/text()')

The reason for this, is because I want to pull a dynamic time out of some XML (in this case, a message from a Amazon SQS queue that I subscribe to), and tell it to curl a URL at a specific time. That is the real reason that I am trying to get this working.

When I try to pass the time from the XML, I get a completely different error. I have tried sending every type of time format possible, but it still gives me an error. Please help!

/Users/me/.gem/ruby/1.9.1/gems/rufus-scheduler-2.0.16/lib/rufus/sc/rtime.rb:327:in `at_to_f': cannot determine 'at' time from : "1334865999.4416242" (ArgumentError)
    from /Users/me/.gem/ruby/1.9.1/gems/rufus-scheduler-2.0.16/lib/rufus/sc/jobs.rb:253:in `determine_at'
    from /Users/me/.gem/ruby/1.9.1/gems/rufus-scheduler-2.0.16/lib/rufus/sc/jobs.rb:90:in `initialize'
    from /Users/me/.gem/ruby/1.9.1/gems/rufus-scheduler-2.0.16/lib/rufus/sc/me.rb:149:in `new'
    from /Users/me/.gem/ruby/1.9.1/gems/rufus-scheduler-2.0.16/lib/rufus/sc/scheduler.rb:149:in `at'
    from /Users/me/Dropbox/Files/Personal/RubyMine/hbo_hackathon/SOME:18:in `block in <top (required)>'
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T10:45:32+00:00Added an answer on June 2, 2026 at 10:45 am

    OK,

    the first error is not related to rufus-scheduler. It’s probably you passing a nil “url” to the Curl library.

    The second error

    cannot determine ‘at’ time from : “1334865999.4416242” (ArgumentError)

    is rufus-scheduler complaining about getting passed a string it cannot turn into a Time instance.

    Try something like

    starttime = REXML::XPath.first(doc, '/new/time/text()').to_f
    

    So, to summarize, you’re seeing two different errors. Fix them one after the other. Start with the one at the heart : Curl complaining about some nil passed instead of a string, then look at the starttime issue.

    Cheers,

    John

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hell All, So I have been facing this behavior for quite some time and
I'm having a hell of a time getting WCF Data Services to work within
I'm having a hell of a time with some Apache NMS issues. Part of
I am having a hell of a time getting a MovieClip to detect whether
I'm having a hell of a time trying to debug some kind of memory
I am having a hell of a time getting my extension up on Magento
help me here im drowning in switch / if / else hell .... im
At the moment i working with library which can throw hell alot of different
I'm having a hell of a time trying to find sybase documentation that says
I am having one hell of a problem that I cannot figure out for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.