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 8539259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:19:18+00:00 2026-06-11T11:19:18+00:00

I am using the ruby sprinkle gem (using Capistrano as its deployment mechanism) to

  • 0

I am using the ruby sprinkle gem (using Capistrano as its deployment mechanism) to execute a command to start a simple ruby app on a remote Ubuntu server. Below is a small snippet of the ruby app code where I think the problem could lie.

...
require 'eventmachine'
...
fork { run }

def run
    EM.run{
        Signal.trap('INT') { @log.debug("trapped INT signal"); stop(true) }
        Signal.trap('TERM'){ @log.debug("trapped TERM signal"); stop(true) }

        begin 

            pulsate
            @log.info "still ok here"
            EM.add_periodic_timer 60 do  # 1 minute
                @log.info "doesn't get here"                    
                pulsate
            end
            @log.info "doesn't get here"

        rescue => exc
            #never gets here    
            @log.error "Unable to add EM timer due to: #{exc}"
            exit -1
        end  
    }
end 

def pulsate...
def stop...
etc
...

The strange thing is that it all runs without any problems when I ssh on to the server and run it there. However when using sprinkle/capistrano, as soon as the process hits the EM.add_periodic_timer it just disappears. No exception is thrown, no signals, no log output, it just seems to never get to the next line?

Also, I am using the latest version of the EventMachine gem: eventmachine (1.0.0.rc.4) and capistrano (2.12.0) (sprinkle is a red herring I think as it just falls back on capistrano)

Any ideas of why it could fail during the remote execution but not when executed in place on the server? Any ideas of things I can try to get more information?

  • 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-11T11:19:20+00:00Added an answer on June 11, 2026 at 11:19 am

    Try setting the global EM error handler before calling EM.run. You can see the documentation at EM#error_handler which may give you a clue as to what’s going on.

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

Sidebar

Related Questions

This simple daemon (written using ruby daemons gem) prints numbers from 0 up to
Using Ruby on Rails, if I do a gem help install a part of
Using Ruby 1.9.3 and bcrypt-ruby 3.0.1 I'm working on the Depot app from the
Using ruby ssh to exec a shell process that runs continuously on a remote
Using ruby 1.9 and latest gem install pcap + fix for compiling (convert ->ptr
Using Ruby on Rails combined with capistrano and git, I've run into an annoying
I am using Ruby console. I start it by using Rails console and then
I'm using Ruby 1.9.2-p180 on Ubuntu 12.04. I don't understand why the following code
I am using Ruby on Rails 3 and I would like to start to
Using Ruby on Rails 3, I have a page with a list of comments

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.