capistrano-strategy-copy-bundled icon indicating copy to clipboard operation
capistrano-strategy-copy-bundled copied to clipboard

problem with native extensions

Open deric opened this issue 12 years ago • 2 comments

When development machine run on different architecture or just depends on different versions of system libraries, the bunde will fail. Is it possible to skip packing gems with native extensions?

deric avatar Feb 19 '13 11:02 deric

Hmm... good question. My first answer would be: not really.

Capistrano does not know whether a gem has native extensions (nor does bundler). Also, if you bundle gems on the target host... why use the copy bundled gem? It was intended for those environments, where bundling on the target machine is not permitted. This kind of dictates that your deploy machine needs to have the same architecture.

rudionrails avatar Feb 19 '13 11:02 rudionrails

Ohh here's one on second thought: Since you can group your gems within your Gemfile... why not do something like this:

# in your Gemfile

group :native do
  gem 'the-one-with-native-extensions'
end

Then, in your deploy.rb:

require 'capistrano-strategy-copy-bundled'
set :deploy_via, :copy_bundled
set :bundle_without, [:development, :test, :native] 

rudionrails avatar Feb 19 '13 11:02 rudionrails