0

http://rubygems.org/gems/capistrano/versions/2.15.5

I would like to use net-ssh version 2.7.0 instead of 2.8.0, with the above capistrano version. How do I specify this in my Gemfile

I added the following to the Gemfile and the resultant Gemfile.lock is given below. Even then I see net-ssh 2.7.0 and 2.8.0 in the shared bundle folder.

gem 'net-ssh', '2.7.0'

capistrano (2.15.5)
  highline
  net-scp (>= 1.0.0)
  net-sftp (>= 2.0.0)
  net-ssh (>= 2.0.14)
  net-ssh-gateway (>= 1.1.0)
net-scp (1.1.2)
  net-ssh (>= 2.6.5)
net-sftp (2.1.2)
  net-ssh (>= 2.6.5)
net-ssh (2.7.0)
net-ssh-gateway (1.2.0)
  net-ssh (>= 2.6.5)

net-ssh (= 2.7.0)

Rpj
  • 5,348
  • 16
  • 62
  • 122
  • there's no reference to 2.8.0 in your Gemfile or Gemfile.lock. Just because it was previously installed, doesn't mean your bundle is using it. – sevenseacat Feb 27 '14 at 05:40

2 Answers2

2

Usinmg bundler you can specify the version of the gem using three different methods

gem 'net-ssh', '2.7.0'    # Exactly version 2.7.0 
gem 'net-ssh', '>=2.7.0'  # Any version greater than or equal to 2.7.0 
gem 'net-ssh', '~>2.7.0'  # Any version within the same major release so 2.7.x

The bundler documentation is available here http://bundler.io/

Steve Weet
  • 28,126
  • 11
  • 70
  • 86
  • 1
    bundler 1.6 is almost out, you may as well link to up to date docs :P – sevenseacat Feb 24 '14 at 08:50
  • @sevenseacat Indded I should. Linked to the first one google showed me. Edited now – Steve Weet Feb 24 '14 at 10:17
  • I added some notes in my question, this doesn't seem to work. capistrano gem depends on net-ssh and I want to tie that particular version to 2.7.0, it seems to pull both 2.7.0 and 2.8.0 as well on a bundle install or even if I remove the gems and try it again. – Rpj Feb 25 '14 at 05:24
  • it's not pulling 2.8.0, and not using it. – sevenseacat Feb 27 '14 at 05:41
  • Why do you think it is using 2.8.0? Is there any mention of 2.8.0 in your Gemfile.lock? – Steve Weet Feb 27 '14 at 09:31
  • I see both versions and I am not sure which version is being used. How is it possible to know when both gems are in the local gemset. – Rpj Mar 12 '14 at 04:31
1

Same way you would specify any other gem - gem 'net-ssh', '2.7.0'

sevenseacat
  • 24,699
  • 6
  • 63
  • 88