一个大小写引发的血案

在我刚开始写ruby的时候,完全不知道ruby里面的命名规则是个什么鬼,在最开始的时候,有一些文件还是按照自己的习惯给文件名大写开头。这个在本机跑的时候没有任何问题,但是一旦开始要与其他类库交叉使用的时候,问题就来了。

首先是sidekiq, 总是提示Cannot define multiple 'included' blocks for a Concern,搜索了很多,一直解决不了,后来不得不提了个issue sidekiq#2942,大家在最后也可以看到得到了解答,去把大写开头的文件改成了小写。

我以为这就结束了,然而并没有。。我还是太naive了!这个问题之后遇到了一些问题,比如:如何:一个server上配置多个github-deploy-key。这个问题的后半部分关于ssh-agent和代号使用问题也是我血肉之躯趟过的呀,最后的最后我仍然还有一个疑问,我甚至还给了github support发了邮件。下面是我的一个阐述:

Hi John,

Thanks for the response. I realized that I may have made some mistake. I ran the ‘git clone git@github.com:LinkFirms/Apollo.git’ instead of ‘git clone git@apollo:LinkFirms/Apollo.git’. If I use the latter, It both work.

But I use git clone git@github.com:LinkFirms/Apollo.git because It seem to be the way my automatic deployment tool did. In the settings file:

1
2
3
set :repository, 'git@github.com:LinkFirms/Apollo.git'
set :branch, 'release'
set :forward_agent, true

and here is the mina code . As the code run , I think It goes ‘git clone git@github.com:LinkFirms/Apollo.git’ finally, But what confused me is that the deployment did work!

So What caused the difference?
(If I don’t make myself clear, please let me know.)

Thanks,
even

github的ssh配置解决之后,万事大吉,只欠东风!但是,又碰到了一个问题

1
! Unable to load application: NameError: uninitialized constant Api::V1::BaseController::Authenticatable

后来为了搞清楚到底是为什么,我把自己的mac环境也换成了puma来跑,一切都很正常,那到底什么为什么呢,是运行环境的问题,那行,我也用production环境跑,也没问题呀!这到底是为什么?!

于是,我又去打扰大神去提了个issue puma#972 正如你们所见,他们说不关puma的事情。

我自己继续琢磨,觉得应该是部署环境的文件问题,导致了跟sidekiq同样的加载问题。所以我去查看了github上的release分支上这个对应的文件。事实证明:文件名还是大写!文件名还是大写!文件名还是大写!这不是坑爹呐!摔!请自行脑补我的反应。。

原来文件系统对大小写并不做区分,所以这个改动并没有push到github,参照 Case sensitivity in Git 之后,我终于完成了此次在一台服务器上部署多个项目的进程。大概都要崩溃了。。

多么痛的领悟