【问题标题】:how to specify path to Gemfile.lock during bundle install with capistrano如何在使用 capistrano 进行捆绑安装期间指定 Gemfile.lock 的路径
【发布时间】:2012-01-04 00:22:11
【问题描述】:

我的目录结构如下:

application/
  tmp/
  rails_code/Capfile
  rails_code/config/deploy.rb
  rails_code/Gemfile
  rails_code/Gemfile.lock
  non_rails_code/

我正在使用 capistrano 部署应用程序代码,但是当我运行 cap deploy 时,它无法使用 bundler 安装 gems,因为它希望 Gemfile.lock 在应用程序目录中,而它实际上在应用程序中/rails_code 目录。

如何指定 Gemfile 的正确位置?

【问题讨论】:

    标签: ruby-on-rails rvm capistrano bundler


    【解决方案1】:

    这是可配置的,请执行:

    set :bundle_gemfile,  "rails_code/Gemfile"
    

    【讨论】:

    • 当 Capistrano 设置无效的 Gemfile 时,这对我也有帮助,例如: failed: "sh -c 'cd /home/rails/alpineanswers-staging/releases/v0.87 && bundle install --gemfile /home/rails/alpineanswers-staging/releases/v0.87/home/rails/alpineanswers-staging/releases/v0.87/Gemfile --path /home/rails/alpineanswers-staging/shared/bundle --deployment --没有开发测试'"
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-04-05
    • 1970-01-01
    • 2012-11-12
    • 2011-05-03
    • 1970-01-01
    • 2013-10-22
    • 2013-10-25
    相关资源
    最近更新 更多