Search code examples
ruby-on-railscapistrano

Capistrano version conflict


I'm trying to upload my Rails app with:

bin/cap production deploy

but the deployment is failing with this error message:

You have requested:                                                                     
  capistrano ~> 3.3.0                                                                   

The bundle currently has capistrano locked at 3.7.1.                                    
Try running `bundle update capistrano`                                                  

If you are updating multiple gems in your Gemfile at once,                              
try passing them all to `bundle update`

I tried to fix the issue by running:

bundle update capistrano

but that did not solve it.

The thing I don't get is that I don't see where my application 'asks for capistrano 3.3.0'. In my Gemfile I set Capistrano to version 3.7.

Besides the capistrano gem I'm also using:

gem capistrano-rails, '~> 1.2'
gem capistrano3-delayed-job, '~> 1.3'
gem capistrano-figaro-yml

My Gemfile is at:

https://github.com/acandael/personalsite/blob/master/Gemfile

Does someone know how I can fix this Capistrano version issue?

thanks for your help,

Anthony


Solution

  • Please follow all the steps in the right order (don't skip any because you did it)

    1. cd into your project directory
    2. run bundle exec gem uninstall capistrano -a to remove all capistrano versions from your bundle
    3. run gem uninstall capistrano -a to remove all capistrano versions from your system. Note that you may need to run this with root access if you get an error message
    4. run bundle install
    5. run bundle exec gem list capistrano which should output all installed gems with a name that contains "capistrano". You are supposed to have only one version of the capistrano gem
    6. check in your files config/deploy.rb and config/deploy/*.rb if you have a lock 3.x.x instruction, and make sure it matches the install version as show in step 5
    7. run cap in bundle context with bundle exec cap production deploy (use exactly this command line, do not use bin/cap)