连接失败:domain.com(NoMethodError:未定义方法“>”对于 true:TrueClass)
我不知道发生了什么,这让我脱光了头发!
我试图使 cap:deploy 命令起作用,然后,不知何故,我收到此错误: 连接失败:domain.com(NoMethodError:未定义方法
>' for true:TrueClass)`
我根本没有编辑代码。为了尝试找出问题所在,我开始逐行删除deploy.rb文件中的行,我意识到如果不存在这三行中的至少一行,则不会发生错误。
role :web, "domain.com"
role :app, "domain.com"
role :db, "domain.com", :primary => true
然后当然它给了我另一个关于服务器不存在的错误。知道什么可能会给我这个错误吗?
就在出现此错误之前,我试图将其设置正确...
$:.unshift(File.expand_path('./lib', ENV['rvm_path']))
require "rvm/capistrano"
set :rvm_bin_path, "$HOME/.rvm/bin/"
set :rvm_path, "/usr/local/rvm/"
set :rvm_ruby_string, '1.9.2-p290'
set :rvm_type, :user
但如果我删除这些行并再次运行 cap deploy:setup ,它仍然会给我相同的错误。
不知道是什么原因造成的!
I have no idea what happened and this is leaving me hairless!
I was trying to make the cap:deploy command work, then, out of nowhere, i get this error:connection failed for: domain.com (NoMethodError: undefined method
>' for true:TrueClass) `
I did not edit the code at all. To try to pinpoint where the problem is, I started deleting line by line in the deploy.rb file and i realized that if there is not at least one of these 3 lines present, the error doesn't happen.
role :web, "domain.com"
role :app, "domain.com"
role :db, "domain.com", :primary => true
and then of course it gives me another error about servers not being present. any idea what could be giving me this error?
Just prior to getting this error I was trying to set this right...
$:.unshift(File.expand_path('./lib', ENV['rvm_path']))
require "rvm/capistrano"
set :rvm_bin_path, "$HOME/.rvm/bin/"
set :rvm_path, "/usr/local/rvm/"
set :rvm_ruby_string, '1.9.2-p290'
set :rvm_type, :user
but if i delete those lines and run cap deploy:setup again it still gives me the same error.
NO IDEA WHAT CAUSED IT!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
每当您看到这样的错误时:
我通常发现这是由于定义的
symbol =>; value
在这种情况下,你的值是
>对于 true:TrueClass
,所以尝试去掉, :primary =>; true
如果这是罪魁祸首,请检查部署文件中的设置,或者查看您定义的符号是否实际存在/适用,或者您的语法是否正确。
在我的一个例子中,我有一个
if
语句,例如:在导致错误的模型中,我需要将其转换为
Proc
(我扩展了一些额外的内容)以防其他人出于不同原因使用相同的未定义方法。)
Whenever you see an error that says:
I've usually found that it's due to a definition's
symbol => value
In this case, yours says
> for true:TrueClass
, so try taking off the, :primary => true
If that's the culprit, either check your settings in your deploy file or see if the symbol you defined is one that actually exists / applies, or if your syntax is correct.
In one case for mine, I had an
if
statement like:in a model that caused the error, and I needed to convert it into a
Proc
(I expanded a little extra just in case others have the same undefined method for a different reason.)