Comments (1)
Hello @fxfactorial
I'm not a Bundler expert or understand fully your setup and what you're trying to achieve (or how this relates in any way with gem-compiler or your previous report #25), but going to try to answer.
I created an empty directory and setup, for testing, just unf_ext
gem:
https://gist.github.com/luislavena/4c24c4881f071578441eb4876d064a01
With just Gemfile
(no lockfile), I proceed to generate the lockfile without installing any gem:
$ ls
Gemfile
$ bundle lock
Fetching gem metadata from https://rubygems.org/.
Fetching version metadata from https://rubygems.org/
Resolving dependencies...
Writing lockfile to ~/code/_sandbox/gem-compiler-issue-26/Gemfile.lock
Inspecting the lockfile will show the contents from the gist linked above.
Now, installing the gems from the bundle:
$ bundle install --path vendor/bundle
Fetching gem metadata from https://rubygems.org/.
Fetching version metadata from https://rubygems.org/
Using bundler 1.15.4
Fetching unf_ext 0.0.7.4
Installing unf_ext 0.0.7.4 with native extensions
Bundle complete! 1 Gemfile dependency, 2 gems now installed.
Bundled gems are installed into ./vendor/bundle.
Notice Installing unf_ext 0.0.7.4 with native extensions
, this means it installed the ruby
platform gem (no platform in the gem) and then proceeded to compile.
Doing bundle package
now will place unf_ext-0.0.7.4.gem
in vendor/cache
:
$ bundle package
Using bundler 1.15.4
Using unf_ext 0.0.7.4
Bundle complete! 1 Gemfile dependency, 2 gems now installed.
Bundled gems are installed into ./vendor/bundle.
Updating files in vendor/cache
* unf_ext-0.0.7.4.gem
$ ls vendor/cache/
unf_ext-0.0.7.4.gem
Now, going to produce a native gem for my current platform (x86_64-linux
) and place the precompiled version inside the cache, too:
$ gem compile vendor/cache/unf_ext-0.0.7.4.gem
Unpacking gem: 'unf_ext-0.0.7.4' in temporary directory...
Building native extensions. This could take a while...
... lot of warnings due dependencies ...
Successfully built RubyGem
Name: unf_ext
Version: 0.0.7.4
File: unf_ext-0.0.7.4-x86_64-linux.gem
$ mv unf_ext-0.0.7.4-x86_64-linux.gem vendor/cache/
$ ls vendor/cache/
unf_ext-0.0.7.4.gem unf_ext-0.0.7.4-x86_64-linux.gem
Next, going to remove the installed bundle (from vendor/bundle
used during bundle install
) and proceed to install using --local
flag:
$ rm -rf vendor/bundle/
$ bundle install --local
Using bundler 1.15.4
Installing unf_ext 0.0.7.4 (x86_64-linux)
Updating files in vendor/cache
Bundle complete! 1 Gemfile dependency, 2 gems now installed.
Bundled gems are installed into ./vendor/bundle.
Notice how this time the gem was not compiled but instead the pre-compiled binary was used instead.
From your report, seems you don't have the non-platform specific gem, or maybe you're just adding the platform specific (windows) to vendor/cache
and not the non-precompiled one, not sure.
This is as far I can go on this since this relates more to Bundler and how it works than gem-compiler itself.
I will recommend you reach out to Bundler for support (see here)
Hope that helps.
Cheers.
from gem-compiler.
Related Issues (20)
- Lock down Ruby's ABI when packaging new gem HOT 4
- cannot compile nokogiri HOT 23
- Method to execute commands/scripts before packaging the new gem HOT 7
- Use only in gemfile? HOT 3
- Testing with trunk ruby 2.5.0dev (2017-10-10 trunk 60155) [x64-mingw32] HOT 3
- Packaging gems with non-traditional extensions
- gem compile test-4.0.6.gem HOT 1
- Compiler errors when it finds nothing to do? HOT 5
- Using gem compiler in a restricted server environment HOT 4
- Benchmarks? HOT 3
- Specific case: puma with SSL support HOT 6
- Uploading multiple versions of ABI to rubygems HOT 4
- modify the version of the gem HOT 6
- Thanks!!! HOT 1
- gem-compile fails when gem has no Gemfile (SUSE/OpenSUSE) HOT 11
- Fail when artifacts are empty? HOT 2
- Support for ruby 3.0 HOT 7
- Package not found HOT 4
- mysql2.so is not included in the packed gem HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gem-compiler.