0

Recently I've been trying to upgrade Webistrano from a version that did not use bundler to manage the application gems to one that does. In order to deploy rails applications, we would use require 'bundler/capistrano' in the recipe to have the bundler loaded for the application and other related steps (like precompiling assets, etc.). However, once bundler is used with a Gemfile to specify and load the appropriate gem environment, having require 'bundler/capistrano' throws the following error:

** loading stage recipe 'bundler'

*** defining a task named `install' would shadow an existing method with that name

If I exclude the require from the recipe, the deploy continues but does not use bundler (no bundle exec, etc.)

I also have similar issues with require 'rvm/capistrano' when attempting to use rvm to manage the ruby environment.

Any thoughts on how to fix this?

Community
  • 1
  • 1
achinda99
  • 5,020
  • 4
  • 34
  • 42

3 Answers3

1

Maybe it's because you are using rake 0.9.x which has install task https://github.com/jimweirich/rake/blob/master/lib/rake/contrib/sys.rb#L30 try to run with rake 0.8.7 This issue might be related https://github.com/capistrano/capistrano/pull/90

Shtirlic
  • 692
  • 1
  • 6
  • 14
0

Do you have the bundler and rvm-capistrano gems installed on your server and local machine? I've seen this causing issues before.

Máté
  • 2,294
  • 3
  • 18
  • 25
0

I had just checked the code of bundler/capistrano and I know code of rvm/capistrano, the only way that could make that happen is when capistrano's namespace is overwritten/broken and does not give a proper scope to task definitions, make sure you do not redefine namespace or there is no other gem/library/code that would do that.

Possibly updating capistrano to newer version could just fix it (that could be some already fixed bug in capistrano).

mpapis
  • 52,729
  • 14
  • 121
  • 158