gpt4 book ai didi

ruby-on-rails-4 - NoMethodError:Capistrano::Configuration:Class 的未定义方法 `instance'

转载 作者:行者123 更新时间:2023-12-02 01:33:16 24 4
gpt4 key购买 nike

我在部署时遇到了一些问题。轨道 4.2.4卡皮斯特拉诺 3.4.0我不明白怎么了。有人可以帮帮我吗?

$ bundle exec cap production deploy --trace** Invoke production (first_time)** Execute production** Invoke load:defaults (first_time)** Execute load:defaultscap aborted!NoMethodError: undefined method `instance' for Capistrano::Configuration:Class/home/denis/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/capistrano.rb:12:in `'config/deploy.rb:13:in `require'config/deploy.rb:13:in `'/home/denis/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/capistrano-3.4.0/lib/capistrano/setup.rb:14:in `load'/home/denis/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/capistrano-3.4.0/lib/capistrano/setup.rb:14:in `block (2 levels) in '/home/denis/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/task.rb:240:in `call'/home/denis/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/task.rb:240:in `block in execute'/home/denis/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/task.rb:235:in `each'/home/denis/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/task.rb:235:in `execute'/home/denis/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/task.rb:179:in `block in invoke_with_call_chain'/home/denis/.rbenv/versions/2.2.2/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'/home/denis/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/task.rb:172:in `invoke_with_call_chain'/home/denis/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/task.rb:165:in `invoke'/home/denis/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/application.rb:150:in `invoke_task'/home/denis/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/application.rb:106:in `block (2 levels) in top_level'/home/denis/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/application.rb:106:in `each'/home/denis/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/application.rb:106:in `block in top_level'/home/denis/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/application.rb:115:in `run_with_threads'/home/denis/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/application.rb:100:in `top_level'/home/denis/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/application.rb:78:in `block in run'/home/denis/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/application.rb:176:in `standard_exception_handling'/home/denis/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/application.rb:75:in `run'/home/denis/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/capistrano-3.4.0/lib/capistrano/application.rb:15:in `run'/home/denis/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/capistrano-3.4.0/bin/cap:3:in `'/home/denis/.rbenv/versions/2.2.2/bin/cap:23:in `load'/home/denis/.rbenv/versions/2.2.2/bin/cap:23:in `'Tasks: TOP => production

我的 Capfile

require 'capistrano/setup'require 'capistrano/deploy'require 'capistrano/rbenv'require 'capistrano/bundler'require 'capistrano/rails/assets'require 'capistrano/rails/migrations'Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }

gem 文件

gem 'capistranogem 'capistrano-bundler'gem 'capistrano-rails'gem 'capistrano-rbenv'

我的 deploy.rb

require 'bundler/capistrano'load 'deploy/assets'set :repository,  "git@bitbucket.org:test/test.git"

最佳答案

您的 deploy.rb 不应包含 require 或 load 行。备份您的配置,删除您的 Capfileconfig/deploy.rbconfig/deploy/*,然后运行 ​​cap install 。修改生成的配置文件。

关于ruby-on-rails-4 - NoMethodError:Capistrano::Configuration:Class 的未定义方法 `instance',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32875737/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com