2011-11-24 25 views
3

GemfileGemfile.lockGit库像http://gembundler.com/deploying.htmlGemfile.lock和gem的特定平台依赖关系?

我用'rbconfig'为防止Linux的生产服务器上加载rb-fsevent但斯特拉努上执行命令'bundle install'

失败我使用Capistrano的与要求'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 

如何避免这种情况?

+1

我觉得这太问题会回答你的问题: [上部署捆扎机错误](http://stackoverflow.com/questions/6472785/bundler-错误的部署) – joshhepworth

回答

0

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

尝试分配宝石一组:gem "rb-fsevent", group: :darwin在你的Gemfile和本地计算机& &推到远程仓库做$ bundle后再试。

2

我有同样的确切问题,看起来bundler已经是resolved this,但没有很好的记录。

尝试用install_if和拉姆达:

gem 'rb-fsevent', install_if: ->() { `uname` =~ /darwin/i }