简体   繁体   English

Rails和Capistrano-部署gem问题

[英]Rails & Capistrano - Deployment gem issues

I've frozen my gems locally, and commit them in latest git version. 我已经在本地冻结了我的宝石,并以最新的git版本提交了它们。 I pushed this to my production server, and my capfile automatically pulls this when deploying (via locally stored git). 我将其推送到生产服务器,并且我的capfile在部署时(通过本地存储的git)自动将其拉出。

Now the issue I run into is that even though I know the server has the gem installed, when I deploy using "cap deploy:cold", I get the following error: 现在我遇到的问题是,即使我知道服务器已安装了gem,当我使用“ cap deploy:cold”进行部署时,也会出现以下错误:

*** [err :: domain.com] Missing these required gems:
*** [err :: domain.com] RedCloth
*** [err :: domain.com] 
*** [err :: domain.com] You're running:
*** [err :: domain.com] ruby 1.8.7.174 at /usr/bin/ruby1.8
*** [err :: domain.com] rubygems 1.3.5 at /home/user/.gem/ruby/1.8, /usr/lib/ruby/gems/1.8
*** [err :: domain.com] 
*** [err :: domain.com] Run `rake gems:install` to install the missing gems.

Should I run rake gems:install in the latest release? 我应该在最新版本中运行rake gems:install吗? When I do this nothing happens. 当我这样做时,什么也没有发生。 Am I supposed to do rake gems:build somewhere; 我应该做耙子宝石吗? in my capfile? 在我的capfile中? I do this in the latest release via console and in that directory and I do not get notices that anything was built, but I probably don't understand that function to begin with. 我是通过控制台和该目录在最新发行版中执行此操作的,我没有收到任何已构建内容的通知,但是我可能不理解该功能开头。

What am I missing? 我想念什么?

Note. 注意。 When I run gem list, I do see the gem install on the production server. 运行gem list时,我确实看到gem安装在生产服务器上。

Because you say gem list includes RedCloth, the problem should be elsewhere. 因为您说gem list包括RedCloth,所以问题应该出在其他地方。

How do you include the Gem in your application? 您如何在应用程序中包含宝石? RedCloth is a bit unconventional. RedCloth有点不合常规。 The name of the gem is CamelCase while the main file is lowercase. 宝石的名称为CamelCase,而主文件为小写。

For this reason, you should specify the :lib option. 因此,您应该指定:lib选项。

config.gem "RedCloth", :lib => "redcloth"

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM