Rails 4, Capistrano 3.0.0, cannot load such file — deploy

后端 未结 9 1108
心在旅途
心在旅途 2020-12-13 08:47

I just ran bundle update and capistrano got updated to 3.0.0 but now when I run cap deploy I get an error and can\'t figure out how to fix this. I have been updating my serv

相关标签:
9条回答
  • 2020-12-13 09:13

    Instead of downgrading to Capistrano 2 use the new configuration from the current version.

    require "capistrano/bundler"
    require "capistrano/rails/assets"
    require "capistrano/rails/migrations"
    

    See also this nice posting, which summarises the differences between Capistrano 2 and 3.

    0 讨论(0)
  • 2020-12-13 09:14

    Make sure you are using bundle exec (most likely you have multiple gem versions of capistrano)

    i.e.

    bundle exec cap -T

    0 讨论(0)
  • 2020-12-13 09:15

    The fastest way to fix this I have found is to backup the cap files (Capfile, config/deploy.rb, and config/deploy/*.rb) and then re capify (it's no longer called "capify"):

    bundle exec cap install STAGES=staging,production
    

    Then recreate your cap files from your backup. It will take you 5 minutes to do this and you'll be over the major Capistrano upgrade hump.

    0 讨论(0)
  • 2020-12-13 09:18

    I had this problem today and pastullo's solution above fixed it except that I had to run gem uninstall capistrano (as markhorrocks answered) not bundle uninstall capistrano.

    I also found this blog on bundler very useful: http://viget.com/extend/bundler-best-practices

    Thanks for sharing this as it saved me heaps of time. x

    0 讨论(0)
  • 2020-12-13 09:19

    I had to run gem uninstall capistrano

    then update the gemfile with gem 'capistrano', '~> 2.15'

    and then run to reinstall the correct version again with bundle update capistrano

    0 讨论(0)
  • 2020-12-13 09:21

    I used

    bundle exec cap production deploy

    instead of just cap production deploy

    0 讨论(0)
提交回复
热议问题