【问题标题】:Capistrano's Failure卡皮斯特拉诺的失败
【发布时间】:2009-08-18 11:28:23
【问题描述】:

这是我第一次使用 Capistrano,而且在没有它的情况下应用程序已经发布。当我键入 cap deploy:migrations 时,在一些成功的命令后出现以下错误:

 * 执行“cd /home/collimarco/foto-fiori.com/releases/20090818111104; rake RAILS_ENV=production db:migrate”
    服务器:[“foto-fiori.com”]
    [foto-fiori.com] 执行命令
 ** [out :: foto-fiori.com](在 /home/collimarco/foto-fiori.com/releases/20090818111104 中)
 ** [out :: foto-fiori.com] 缺少 Rails 2.3.3 gem。请 `gem install -v=2.3.3 rails`,更新 config/environment.rb 中的 RAILS_GEM_VERSION 设置以获取已安装的 Rails 版本,或注释掉 RAILS_GEM_VERSION 以使用安装的最新版本。
    命令完成
失败:foto-fiori.com 上的“sh -c 'cd /home/collimarco/foto-fiori.com/releases/20090818111104; rake RAILS_ENV=production db:migrate'”

我试图从 environment.rb 中注释掉 RAILS_GEM_VERSION,但还是一样。

我还手动输入了最后一个命令:

$ cd /home/collimarco/foto-fiori.com/releases/20090818111104
$ rake RAILS_ENV=生产数据库:迁移
(在/home/collimarco/foto-fiori.com/releases/20090818111104)
耙中止!
没有这样的文件或目录 - /home/collimarco/foto-fiori.com/releases/20090818111104/config/database.yml
/home/collimarco/foto-fiori.com/releases/20090818111104/Rakefile:10
(通过使用 --trace 运行任务查看完整跟踪)

有什么想法吗?

【问题讨论】:

    标签: ruby-on-rails deployment capistrano


    【解决方案1】:
     ** [out :: foto-fiori.com] Missing the Rails 2.3.3 gem. Please `gem install -v=2.3.3 rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.
    

    你的问题就在那里。您需要安装 Rails 2.3.3。

    您似乎还缺少您的 database.yml 文件,我假设这只是源代码控制遗漏的东西?

    【讨论】:

    • 不要将 database.yml 放在源代码管理中。您应该在 #{shared_pa​​th}/config 中有它,然后使用 deploy.rb 中的 after deploy:update_code 钩子将其复制到您的配置目录上 将此文件放入源代码管理中存在安全风险。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-10-02
    • 1970-01-01
    • 2017-10-23
    • 1970-01-01
    相关资源
    最近更新 更多