Joel AZEMAR
Joel AZEMAR

Reputation: 2526

Gemfile.lock and gem's specific platform dependency?

My Gemfile and Gemfile.lock is in Git repository like http://gembundler.com/deploying.html

I use 'rbconfig' for prevent to load rb-fsevent on linux production server but capistrano fail on executing command 'bundle install'

I use capistrano with require 'bundler/capistrano'

See stack trace :

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

in my Gemfile :

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

How to avoid this?

Upvotes: 4

Views: 1355

Answers (2)

caesarsol
caesarsol

Reputation: 2113

I had the same exact problem, it appears that bundler already resolved this, but is not well documented.

Try with install_if and a lambda:

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

Upvotes: 2

wonook
wonook

Reputation: 43

On Capistrano, you can set an option like set :bundle_without, [:darwin] to skip certain groups while bundling your gems in production.

Try assigning the gem to a group: gem "rb-fsevent", group: :darwin in your Gemfile and try again after doing $ bundle on your local machine && pushing to your remote repository.

Upvotes: 0

Related Questions