简体   繁体   English

NameError:未初始化的常量 Capistrano::Puma

[英]NameError: uninitialized constant Capistrano::Puma

I got NameError: uninitialized constant Capistrano::Puma with this Gemfile :我得到NameError: uninitialized constant Capistrano::Puma with this Gemfile

source "https://rubygems.org"

ruby "2.7.1"

gem "rails"
gem "pg"
gem "puma"
gem "webpacker"
gem "jbuilder"
gem "bcrypt"
gem "slim-rails"
gem "emoji_regex"
gem "dotenv-rails"

gem "bootsnap", require: false

group :development, :test do
  gem "byebug"
end

group :development do
  gem "web-console"
  gem "listen"
  gem "spring"
  gem "spring-watcher-listen"

  gem "capistrano"
  gem "capistrano-rails"
  gem "capistrano-rbenv"
  gem "capistrano3-puma", "4.0.0"
end

group :test do
  gem "capybara"
  gem "selenium-webdriver"
  gem "webdrivers"
  gem "shoulda-context"
end

and this Capfile :和这个Capfile

require "capistrano/setup"
require "capistrano/deploy"
require "capistrano/rails"
require "capistrano/rbenv"
require "capistrano/bundler"
require "capistrano/scm/git"
require "capistrano/puma"

install_plugin Capistrano::Puma
install_plugin Capistrano::SCM::Git

set :rbenv_type, :user
set :rbenv_ruby, "2.7.1"

Dir.glob("lib/capistrano/tasks/*.rake").each { |r| import r }

I thought it was spring, then bootsnap, then my environment, but I have the exact same capistrano config on other projects and they work fine.我以为是春天,然后是 bootsnap,然后是我的环境,但我在其他项目上有完全相同的 capistrano 配置,并且它们工作正常。

i think i will also post an issue to the capistrano3-puma repository我想我也会向 capistrano3-puma 存储库发布一个问题

The solution was to lock the version of capistrano3-puma to 4.0.0 :解决方案是将capistrano3-puma的版本锁定到4.0.0

gem "capistrano3-puma", "4.0.0"

because i was using puma 5 and the most recent version of capistrano3-puma was 1.2.1因为我使用的是 puma 5 而最新版本的 capistrano3-puma 是 1.2.1

see this diff:看到这个差异:

-    capistrano3-puma (1.2.1)
-      capistrano (~> 3.0)
-      puma (>= 2.6)
+    capistrano3-puma (4.0.0)
+      capistrano (~> 3.7)
+      capistrano-bundler
+      puma (~> 4.0)

I had the same issue.我遇到过同样的问题。 This was because, by mistake, I had installed capistrano-puma .这是因为我错误地安装了capistrano-puma

To fix the issue:要解决此问题:

sudo gem uninstall capistrano-puma

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Puma:无法加载应用程序:NameError:未初始化的常量 - Puma: Unable to load application: NameError: uninitialized constant Capistrano部署独角兽ERROR未初始化的常量RAILS_ENV(NameError) - Capistrano deploy unicorn ERROR uninitialized constant RAILS_ENV (NameError) capistrano - NameError:未初始化的常量Net :: SSH :: KnownHosts :: SUPPORTED_TYPE - capistrano - NameError: uninitialized constant Net::SSH::KnownHosts::SUPPORTED_TYPE Ruby on Rails Tutorial by Michael - Chapter -2 Toy App - Puma 发现了这个错误:未初始化的常量 ApplicationController (NameError) - Ruby on Rails Tutorial by Michael - Chapter -2 Toy App - Puma caught this error: uninitialized constant ApplicationController (NameError) Ruby PUMA错误:“无法加载应用程序:NameError:未初始化的常量Service :: Resolv” - Ruby PUMA error: “Unable to load application: NameError: uninitialized constant Service::Resolv” 未初始化的常量TestFactories(NameError) - uninitialized constant TestFactories (NameError) 未初始化的常量 ActionController (NameError) - uninitialized constant ActionController (NameError) NameError:未初始化的常量用户 - NameError: uninitialized constant User NameError:RSpec上的未初始化常量 - NameError: uninitialized constant on RSpec NameError,未初始化的常量 - NameError, uninitialized constant
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM