Capistrano -“无法加载此类文件——部署”

时间:2022-03-07 20:37:39

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?

在一个现有的rails项目上工作,该项目被设置为与Capistrano一起部署。试着确定我解决这个错误的第一步。谁能告诉我该怎么做?

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

Capfile下面

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.

谢谢!希望这是足够的信息。

2 个解决方案

#1


32  

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.

您正在使用Capistrano 3,但是您正在使用的项目可能是为Capistrano 2设置的。版本3是一个完整的重写,需要大量的配置更新才能工作。

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).

假设你有正确的2。在项目的Gemfile中,应该使用bundle exec cap(用于使用项目版本),而不是cap(将使用全球安装的3)。x版本)。

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

有一个升级指南,虽然它不是很深入。

#2


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.

您需要移动/删除旧的cap文件,就像您的项目在使用cap 2而不是cap 3之前一样。现在,如果你想升级你的上限到3,在此之前。

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 :)

现在您可以继续执行相同的命令。所有最好的:)

#1


32  

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.

您正在使用Capistrano 3,但是您正在使用的项目可能是为Capistrano 2设置的。版本3是一个完整的重写,需要大量的配置更新才能工作。

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).

假设你有正确的2。在项目的Gemfile中,应该使用bundle exec cap(用于使用项目版本),而不是cap(将使用全球安装的3)。x版本)。

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

有一个升级指南,虽然它不是很深入。

#2


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.

您需要移动/删除旧的cap文件,就像您的项目在使用cap 2而不是cap 3之前一样。现在,如果你想升级你的上限到3,在此之前。

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 :)

现在您可以继续执行相同的命令。所有最好的:)