Comments (11)
I think I saw this message some decent time ago.
And the message is pretty accurate, here is the spec for this case: https://github.com/rubygems/rubygems/blob/8bff4a99ac4bd8cecd3345369c231bca92215386/bundler/spec/install/gemfile/platform_spec.rb#L233-L257
image_optim_pack
shouldn't fit the case as platform versions have exactly same dependencies as "ruby" version.
To confirm that nothing is wrong I downloaded all platform versions for latest gem and compared metadata, the difference is only in platform and list of files.
I'm wondering if it is something that was fixed in latest bundler version, but as I remember the version of bundler is fixed on Heroku, right?
Is it possible to somehow debug the resolution process?
from image_optim_pack.
The inner workings of bundler are a mystery to me. I was hoping this would make more sense to you.
That said, it might be worth noting that my local version of bundler is 2.1.4, so Heroku uses a different version when compiling (2.0.2). It could very well be an issue that is fixed in newer releases of bundler.
from image_optim_pack.
To experiment I've updated https://iopack.herokuapp.com/ to ruby 2.7.1 and it is using bundler 2.0.2, but deployment went without problems. Could you try to create and share some minimal reproducible example of heroku app that fails?
from image_optim_pack.
I think that I saw this when deploying to Heroku because I tend to watch the output, but I've discovered this isn't a deployment error.
$ rails new my_new_app -M -O -C -S -J -T -B
$ cd my_new_app
# Gemfile
gem 'image_optim_pack'
$ bundle
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64 -mingw32 java`.
Fetching gem metadata from https://rubygems.org/............
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Unable to use the platform-specific (x86_64-darwin) version of image_optim_pack (0.6.0.20200215) because it has different dependencies from the ruby version. To use the platform-specific version of the gem, run `bundle config set specific_platform true` and install again.
Using rake 13.0.1
# all the other gems...
I'm seeing this locally under the following conditions:
- Bundler 2.1.4
- Ruby 2.7.1
- MacOS
from image_optim_pack.
Something else is affecting as for same version I don't see the warning, maybe some bundler and/or rubygems config? Can you try reproducing it in a Dockerfile?
from image_optim_pack.
I'm not a Docker user, so that's a hefty project for me that I'm unlikely to complete. I realized that I left out the RubyGems version though. I'm on 3.1.4 locally (not sure about Heroku).
from image_optim_pack.
Sure, just wrong assumption that docker is everywhere :)
Still can't reproduce on mac with same versions. Can you try to reduce the Gemfile for heroku app to bare minimum triggering the warning and share it?
from image_optim_pack.
I suspect this issue has its roots locally, rather than with Heroku.
I ran the command from the warning message:
bundle config set specific_platform true
After that, the local install ran without the warning.
To reproduce the warning after it's gone
$ gem uninstall image_optim_pack
$ bundle config unset specific_platform
$ rails new my_new_app2 -M -O -C -S -J -T -B -d postgresql # this must be a different app than before. Not sure why.
$ bundle add image_optim_pack
Deploying this to Heroku yields the error from the OP.
Complete these steps...
$ bundle config set specific_platform true
$ bundle
# commit & deploy
... and the warning message no longer appears during deployment.
Before running bundle config set specific_platform true
Gemfile.lock:
PLATFORMS
ruby
Output of bundle
:
Unable to use the platform-specific (x86_64-darwin) version of image_optim_pack (0.6.0.20200215) because it has different dependencies from the ruby version. To use the platform-specific version of the gem, run `bundle config set specific_platform true` and install again.
...
Using image_optim_pack 0.6.0.20200215
Output during deployment
Unable to use the platform-specific (x86_64-linux) version of image_optim_pack (0.6.0.20200215) because it has different dependencies from the ruby version. To use the platform-specific version of the gem, run `bundle config set specific_platform true` and install again.
...
remote: Using image_optim_pack 0.6.0.20200215
After running bundle config set specific_platform true
Gemfile.lock:
PLATFORMS
ruby
x86_64-darwin-19
Output of bundle
:
# no warning
Using image_optim_pack 0.6.0.20200215 (x86_64-darwin)
Output during deployment
# no warning
remote: Using image_optim_pack 0.6.0.20200215
Notice the lack of platform-specific installation, even though the warning message is gone.
Heroku weirdness
In the output above, Heroku never installs a platform-specific gem like it does locally, even when the warning is not issued.
If you've deployed with the platform specified...
$ heroku run bash
$ cat Gemfile.lock
... yields the following:
PLATFORMS
ruby
x86_64-darwin-19
So, it appears that Heroku doesn't alter Gemfile.lock to correct the platform, and doesn't install the platform-specific version of the gem, even though it complains when Gemfile.lock doesn't specify the platform.
None of this makes it obvious to me why I started seeing these warnings recently, when I hadn't seen them before.
from image_optim_pack.
Sorry for long reply time.
Yesterday I was finally able to reproduce and pinpoint it:
gem uninstall image_optim_pack --all
gem install image_optim_pack --platform ruby
cat <<GEMFILE > Gemfile
source 'https://rubygems.org'
gem 'image_optim'
GEMFILE
bundle
cat <<GEMFILE > Gemfile
source 'https://rubygems.org'
gem 'image_optim'
gem 'image_optim_pack'
GEMFILE
bundle
The problem comes from comparing dependency requirements. Inside Bundler::LazySpecification#__materialize__
there is a comparison of dependencies taking place which fails when comparing following two due to different order of requirements:
<Gem::Dependency type=:runtime name="fspath" requirements="< 4, >= 2.1">
<Gem::Dependency type=:runtime name="fspath" requirements=">= 2.1, < 4">
If sorting is added in Gem::Requirement
, then the warning disappears, and the platform specific version is installed and used.
I'll try to create a PR to rubygems.
from image_optim_pack.
Problem should be fixed starting with bundler 2.2.0.rc.2 (or stable 2.2.0), but as I know Heroku doesn't allow configuring bundler version.
from image_optim_pack.
That's ok, they'll catch up eventually. Thanks for following up!
from image_optim_pack.
Related Issues (20)
- Add archive checksum verification
- Error: uninitialized constant EXIFR::JPEG HOT 1
- Missing binaries error in production HOT 20
- Windows support HOT 4
- image_optim_pack-0.5.0.20171208: uninitialized constant ImageOptim::BinResolver::Bin::Date HOT 3
- Doesn't build on OS X HOT 9
- Remove (nearly-)unused platforms
- Request for help with imagemagick with heic support 😬 HOT 1
- Optimized version guetzli with CUDA & OpenCL
- pngout and svgo not found (with default options) HOT 2
- pngcrush worker: `pngcrush` not found; please provide proper binary or disable this worker HOT 2
- jpegtran from mozjpeg made slightly small files HOT 3
- pngout licence changed? Maybe can be packaged now? HOT 2
- Docker. Debian. Some additional libs are required HOT 3
- Debian [ARM64] `jpeg-recompress` and `oxipng` require `/lib64/ld-linux-x86-64.so.2` HOT 7
- switch to rust version of pngquant
- webp binaries HOT 2
- Add Google Guetzli optimizer HOT 1
- Create task/script to check shared libraries of build binaries HOT 1
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 image_optim_pack.