Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

buildpack bundler version with latest nokogiri (1.11.0 - native gems) fails to deploy #1105

Closed
prognostikos opened this issue Jan 4, 2021 · 9 comments

Comments

@prognostikos
Copy link

We have a rails app where we vendor our gems, developing on Mac. When upgrading Nokogiri from 1.10.0 to 1.11.0 we see a problem where the version of bundler used in the buildpack does not install the Linux version of the gem or fall back to the ruby version of the gem.

This seems to be related to rubygems/rubygems#4012 and looks to be fixed in the latest version of bundler.

For now we have reverted the Nokogiri upgrade in order to be able to continue to use the buildpack, but as 1.11.0 is a security release we'd prefer to upgrade ASAP.

@prognostikos
Copy link
Author

prognostikos commented Jan 4, 2021

Output from the failed build:

-----> Ruby app detected
-----> Installing bundler 2.1.4
-----> Removing BUNDLED WITH version in the Gemfile.lock
-----> Compiling Ruby/Rails
###### WARNING:
       Your app was upgraded to bundler 2.1.4.
       Previously you had a successful deploy with bundler 1.17.3.
       
       If you see problems related to the bundler version please refer to:
       https://devcenter.heroku.com/articles/bundler-version#known-upgrade-issues
       
-----> Using Ruby version: ruby-2.7.2
       Ruby version change detected. Clearing bundler cache.
       Old: ruby 2.6.6p146 (2020-03-31 revision 67876) [x86_64-linux]
       New: ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-linux]
-----> Installing dependencies using bundler 2.1.4
       Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 bundle install -j4
       Some gems seem to be missing from your vendor/cache directory.
       Could not find nokogiri-1.11.0 in any of the sources
       Bundler Output: Some gems seem to be missing from your vendor/cache directory.
       Could not find nokogiri-1.11.0 in any of the sources
 !
 !     Failed to install gems via Bundler.
 !
 !     Push rejected, failed to compile Ruby app.
 !     Push failed

@geoffharcourt
Copy link

The latest Nokogiri release that you're using (1.11.0) has some significant changes with platform-specific code: https://github.com/sparklemotion/nokogiri/releases/tag/v1.11.0. It might be that vendoring Nokogiri means you're now pushing MacOS binaries that won't run on Ubuntu.

@schneems
Copy link
Contributor

schneems commented Jan 4, 2021

where the version of bundler used in the buildpack does not install the Linux version of the gem or fall back to the ruby version of the gem.

It looks like last time you all deployed with 1.17.3. Can you go back to using a 1.x bundler version in the short term?

I've got a branch of Bundler 2.2.3 staged you can try it as well if you want:

$ heroku buildpacks:clear
$ heroku buildpacks:set https://github.com/heroku/heroku-buildpack-ruby#schneems/bundler-2.2.3

From #1104.

@prognostikos
Copy link
Author

prognostikos commented Jan 5, 2021

The latest Nokogiri release that you're using (1.11.0) has some significant changes with platform-specific code: https://github.com/sparklemotion/nokogiri/releases/tag/v1.11.0. It might be that vendoring Nokogiri means you're now pushing MacOS binaries that won't run on Ubuntu.

Yep, that's what's happening, and it is discussed and fixed in rubygems/rubygems#4012 and related PRs/issues. For now we can wait for an upgrade, will test 2.2.3 from #1104 to see if it includes the fix.

@schneems
Copy link
Contributor

This is a related issue that I can repro without Nokogiri rubygems/rubygems#4269.

If this is a nokogiri issue, then I'll open a separate issue to track this bundler problem and close this ticket.

@prognostikos
Copy link
Author

prognostikos commented Jan 11, 2021

@schneems nokogiri was just the first gem we started using with native gems, it's not a nokogiri problem as such. I haven't yet tried your branch with the newer version of bundler as our workaround is good enough at the moment. Feel free to close this - what ever makes most sense to you.

@schneems
Copy link
Contributor

Closing this as it and tracking the still open issue here #1106

@schneems
Copy link
Contributor

@prognostikos try this out on your app:

$ bundle lock --add-platform x86_64-linux
$ bundle install
$ git add . ; git commit -m "Bundler fix"

Then deploy.

If it still doesn't work please open a support ticket https://help.heroku.com and link back to this comment and I can investigate some more.

@prognostikos
Copy link
Author

@schneems yep, we ended up doing that, however for some reason instead of using the linux or mac version it always falls back to compiling the ruby version. Haven't looked into it though, was just glad to be able to upgrade nokogiri and left it there.

judytuna added a commit to judytuna/sweater that referenced this issue Oct 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants