0

I'm having problems installing Ruby 1.9.3-p286 on a (blank) Ubuntu 12.04 box with Capistrano.

What happens is:

 * executing "rbenv install 1.9.3-p286"
   servers: ["178.48.132.196"]
   [178.48.132.196] executing command
** [out :: 178.48.132.196] Downloading http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz...
** [out :: 178.48.132.196] Installing yaml-0.1.4...
** [out :: 178.48.132.196] Installed yaml-0.1.4 to /home/cphrb/.rbenv/versions/1.9.3-p286
** [out :: 178.48.132.196] Downloading http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p286.tar.gz...
** [out :: 176.58.102.156] Installing ruby-1.9.3-p286...

(And here it hangs forever.)

To add to the mystery: This works perfectly fine during office hours (GMT+1) but fails when running in the evening. It's been consistent three nights in a row. When I look at the running processes with top, it seems like the installation finishes as all processes related to the installation are gone. I'm quite curious how the time of day can influence the installation because once the installation is running on the box, it should not depend on any external services that could be down for e.g. maintenance. I've also tried to run the installation manually on the box but with the same result.

Any ideas??

Thanks!

Nicholas
  • 2,147
  • 3
  • 23
  • 31

2 Answers2

1

I experienced similar problem when trying to install ruby 2.0.0-rc2 using rbenv in a Capistrano script.


I added the following to the Ubuntu server's /etc/ssh/sshd_config to :

ClientAliveInterval 20

ClientAliveCountMax 20

The SSH server needs a restart after this re-configuration.


I added the following to my local computer's (Also ubuntu) /etc/ssh/ssh_config to :

ServerAliveInterval 30

ServerAliveCountMax 20

Any open SSH connections need to be closed and reopened to use this configuration.


Those values stopped my ssh session from timing out and my Capistrano recipe completed installing ruby through rbenv. Adding to both the server side and client side probably is overkill. I didn't test fully with only one side of the configuration entered.

Community
  • 1
  • 1
messinga
  • 371
  • 3
  • 14
0

I think the problem is solved: The installation hung because of the SSH connection dying mid-flight. :-(

If there's anyone who knows why SSH does not terminate with an error, I would be happy to know. And if there's any switches that could mitigate the problem.

Nicholas
  • 2,147
  • 3
  • 23
  • 31
  • 1
    You might try adding `ServerAliveInterval 4` to your .ssh/config to ensure data is going across the wire the whole time. ` Host * ServerAliveInterval 4 ` – Jeffrey Hulten Jan 15 '13 at 23:43