正在获取警告:在CAP部署时已对资产预编译的常量&q;进行了初始化 [英] Getting "warning: already initialized constant" on assets precompile at the time of cap deploy

查看:19
本文介绍了正在获取警告:在CAP部署时已对资产预编译的常量&q;进行了初始化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我在Deploy上遇到奇怪的警告消息:Assets:预编译在生产时通过Capstrano部署。

当我第一次运行CAP Products Deploy来部署我的演示Rails项目时,收到以下警告消息,部署失败,CAP已中止!

#<Thread:0x0000558ae4eef218@/home/.rvm/gems/ruby-2.5.0/gems/sshkit-1.21.2/lib/sshkit/runners/parallel.rb:10 run> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
    1: from /home/.rvm/gems/ruby-2.5.0/gems/sshkit-1.21.2/lib/sshkit/runners/parallel.rb:11:in `block (2 levels) in execute'
/home/.rvm/gems/ruby-2.5.0/gems/sshkit-1.21.2/lib/sshkit/runners/parallel.rb:15:in `rescue in block (2 levels) in execute': Exception while executing on host IP: rake exit status: 1 (SSHKit::Runner::ExecuteError)
rake stdout: /home/ubuntu/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/net/protocol.rb:66: warning: already initialized constant Net::ProtocRetryError
/home/ubuntu/apps/demo-test/shared/bundle/ruby/2.5.0/gems/net-protocol-0.1.0/lib/net/protocol.rb:66: warning: previous definition of ProtocRetryError was here
/home/ubuntu/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/net/protocol.rb:172: warning: already initialized constant Net::BufferedIO::BUFSIZE
/home/ubuntu/apps/demo-test/shared/bundle/ruby/2.5.0/gems/net-protocol-0.1.0/lib/net/protocol.rb:206: warning: previous definition of BUFSIZE was here
/home/ubuntu/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/net/protocol.rb:439: warning: already initialized constant Net::NetPrivate::Socket
/home/ubuntu/apps/demo-test/shared/bundle/ruby/2.5.0/gems/net-protocol-0.1.0/lib/net/protocol.rb:503: warning: previous definition of Socket was here
rake stderr: Nothing written
(Backtrace restricted to imported tasks)
cap aborted!

提前谢谢。

推荐答案

这里也一样,它似乎是gem依赖项的一个奇怪的问题 https://github.com/ruby/net-imap/issues/16

如果在gem文件中添加gem "net-http",则该问题应为 无论如何,这个gem应该已经存在于您的gefile.lock作为依赖项

编辑

升级成功后,即可从文件中删除gem 这是一个更新依赖项错误。一旦更新,您就是好人

这篇关于正在获取警告:在CAP部署时已对资产预编译的常量&q;进行了初始化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆