Gemfile.lock和gem的特定平台依赖?

时间:2011-11-24 10:44:07

标签: capistrano bundler

我的GemfileGemfile.lock位于Git存储库中http://gembundler.com/deploying.html

我使用'rbconfig'来防止在linux生产服务器上加载rb-fsevent但是capistrano在执行命令'bundle install'时失败

我使用capistrano with require 'bundler/capistrano'

请参阅堆栈跟踪:

You are trying to install in deployment mode after changing
Your Gemfile. Run 'bundle install' elsewhere and add the
Updated Gemfile.lock to version control.

You have deleted from the Gemfile:
rb-fsevent

Gemfile

case HOST_OS
  when /darwin/i
    gem "rb-fsevent"
end

如何避免这种情况?

2 个答案:

答案 0 :(得分:2)

我遇到了同样的问题,看来捆绑器已经resolved this,但没有很好的记录。

尝试使用NSLayoutConstraint.constraintsWithVisualFormat("", options: [], metrics: nil, views: [:]) 和lambda:

install_if

答案 1 :(得分:0)

在Capistrano上,您可以设置set :bundle_without, [:darwin]之类的选项,以便在生产中捆绑您的宝石时跳过某些群组。

尝试将gem分配给您的Gemfile中的一个组:gem "rb-fsevent", group: :darwin,然后在本地计算机上执行$ bundle后再试一次&&推送到您的远程存储库。

相关问题