Question

I am trying to instal varnish on a cache server. My following stack with be...

HA Proxy Servers ----> Cache (Varnish) Servers ----> Nginx + Unicorn Servers

I have been able to correctly setup all the config files for HAProxy and Varnish to move traffic along the pipeline. However I get an error when try to bootstrap my cache servers.

** ERROR: While executing gem ... (Gem::DependencyError) ** Unable to resolve dependencies: rubber requires net-ssh (~> 2.4.0); fog requires net-ssh (>= 2.1.3); capistrano requires net-ssh (>= 2.0.14); net-ssh-gateway requires net-ssh (>= 2.6.4); net-scp requires net-ssh (>= 2.6.4); net-sftp requires net-ssh (>= 2.6.4) ** /tmp/gem_helper:32:in `block in <main>' ** : Unable to install versioned gem rubber:2.1.2 (RuntimeError ** ) ** from /tmp/gem_helper:30:in `each' ** from /tmp/gem_helper:30:in `<main>'

I can't seem to figure out why this is happening. Any help would be great. Thanks

Was it helpful?

Solution

I had this problem and the solution I found was somewhat unsatisfactory and temporary, but it worked.

This error occurs during the rubber:install_gems task. After it fails, log into the ec2 server via ssh. At this point if you try to run gem install rubber -v=2.1.2 manually in the remote console, it fails with the exact same error you show above. (the version number might be different for you, it depends on the rubber version you had when you did this).

So now create an empty folder with any name, and create an almost-empty Gemfile inside it.

$ mkdir dummy && cd dummy
$ nano Gemfile

Then fill the Gemfile with the following contents:

source 'http://rubygems.org'
gem 'rubber', '2.1.2'

Again, the version of rubber might be different for you.

After creating this file, run bundle install and everything will install correctly. But don't ask me why it works differently when installing rubber via bundler than installing it via a plain old gem install.

So after achieving this, logout from ec2 and re-run cap rubber:bootstrap and it should work.

The unsatisfactory part is that if you decide to create new instances on ec2, it will fail again at the same point, and you'll have to repeat this steps and re-ignite the process manually for it to complete. So if any one can come up with a better solution like modifying rubber or something, let us know.

OTHER TIPS

Let me preface this by saying i had this same problem and solved it but i was not using varnish or unicorn.

It looks like you're missing capistrano, add that to your gemfile and it should take care of most of the dependencies. However in my case rubber complained about requiring net-ssh (~> 2.4.0) and capistrano installs the latest net-ssh gem. So to fix this edit your Gemfile.lock to use net-ssh (2.4.0) instead of the latest version, then running bundle install should fix the dependencies.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top