Capistrano - "cannot load such file --deploy"
Asked Answered
C

2

18

Working on an existing rails project that is set up to deploy with Capistrano. Trying to determine my first step in figuring out this error. Can anyone point me in the right direction of what I need to do?

cap aborted!
cannot load such file -- deploy
/Users/lrh/Projects/Rails/febennett.com/Capfile:1:in `load'
/Users/lrh/Projects/Rails/febennett.com/Capfile:1:in `<top (required)>'
/Users/lrh/.rvm/gems/ruby-2.0.0-p247@febennett/gems/capistrano-      
3.0.1/lib/capistrano/application.rb:22:in `load_rakefile'
/Users/lrh/.rvm/gems/ruby-2.0.0-p247@febennett/gems/capistrano-
3.0.1/lib/capistrano/application.rb:12:in `run'
/Users/lrh/.rvm/gems/ruby-2.0.0-p247@febennett/gems/capistrano-3.0.1/bin/cap:3:in `<top   
(required)>'
/Users/lrh/.rvm/gems/ruby-2.0.0-p247@febennett/bin/cap:23:in `load'
/Users/lrh/.rvm/gems/ruby-2.0.0-p247@febennett/bin/cap:23:in `<main>'
(See full trace by running task with --trace)

Capfile Below

load 'deploy'
# Uncomment if you are using Rails' asset pipeline
load 'deploy/assets'
load 'config/deploy' # remove this line to skip loading any of the default tasks

Thanks! Hope this is sufficient information.

Chilpancingo answered 17/12, 2013 at 19:29 Comment(2)
Show us Capfile. Show us config/deploy.rb (mask out anything sensitive). Show us how you are invoking capistrano.Linctus
possible duplicate of Capistrano no such file to load -- deploySuffruticose
D
39

You're using Capistrano 3, but the project you're using was probably set up for Capistrano 2. Version 3 was a complete rewrite and requires a fair amount of configuration updates to work.

Assuming you have the correct 2.x version of Capistrano in your project's Gemfile, you should be using bundle exec cap (to use your project's version) instead of just cap (which will use the globally-installed 3.x version).

There is an upgrade guide available, though it's not terribly in depth.

Dopp answered 17/12, 2013 at 19:42 Comment(2)
Thanks - this was indeed the case.Chilpancingo
Thank you for this. I thought about this was the case. I'm assuming capistrano 3.0 is aliased over 2.0+Wacke
K
1

You need to move/delete your older cap files as exactly your project was before using cap 2 instead of cap 3. Now if you want to upgrade your cap to 3 do following before this.

Delete the following mentioned files or you can simply move same files somewhere else as below:

mkdir old_cap
mv Capfile old_cap
mv config/deploy.rb old_cap
mv config/deploy/ old_cap # --> only for multistage setups 

Now you can proceed with same command. All the best :)

Kraigkrait answered 9/11, 2015 at 6:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.