tonytonyjan / jaro_winkler

Ruby & C implementation of Jaro-Winkler distance algorithm which supports UTF-8 string.
MIT License
192 stars 29 forks source link

Question regarding environments #23

Open kensentor opened 5 years ago

kensentor commented 5 years ago

This gem is a dependency of rubocop. My development machine is a Mac; my CI machine is Linux. What would be the best practice regarding the gem for these different environments?

For example, if I update my Gemfile to a version of rubocop which uses this gem and use bundle install, Bundler will put jaro_winkler-1.5.1-x86_64-darwin-17.gem into my gem cache directory. I check that in and push it up to my CI. Since you don't want your CI to be reliant on external HTTP calls, it runs bundle install --local --no-prune --no-cache. The CI then fails to find the gem:

Some gems seem to be missing from your vendor/cache directory. Could not find jaro_winkler-1.5.1 in any of the sources

I assume because it's looking for a Linux version of the build. There are other gems in my Gemfile that use native extensions, like nokogiri, which use native extensions but don't seem to have this problem. Is there a difference in the way this gem is built? Is it possible to handle this case through the Gemfile in some way? So far my ideas are pretty exotic, like deploying the gem with the CI image and then moving it into the Bundler cache directory before the CI process gets going.

babelfish commented 5 years ago

Having the same issue but with trying to bundle install in a docker container from a gem cache created on a mac.