You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems likely that the issue here is not that the SDK isn't "cleanly interacting with the http gem", but that the SDK and webmock want two different versions of the http gem. This is a common issue in Ruby and really in any language that has a package manager, but it's largely outside of our control.
You can see in our gemspec that the SDK is requesting version "~>4.4.1" of http— that is, 4.4.1 or a higher compatible version.
And in Webmock's gemspec, there is a requirement for version ">=0.8.0" of http. That's a very broad requirement (0.8.0 was 6 years ago)— which would be fine if Webmock really were OK with any version greater than or equal to 0.8.0, but it seems like it is not.
From the information you provided, there's no way for me to know what version of http you actually have— which could also be affected by other dependencies in your project. If it were 4.4.1, I would not expect this error from Webmock because the specific failure that Webmock is having (not being able to find a perform method in HTTP::Client) doesn't make sense for any recent version of http, since the perform method does exist in those. (It does not exist in 0.8.0 though, so I don't know why they declared their requirement in that way; in other words, at first glance it looks to me like Webmock would not actually work with what they say is their minimum http version. But, due to our SDK's request for a higher version, I would not expect that such an old version would be loaded.)
I can't really say more without being able to see the list of dependency gems/versions as they are declared in your project (and how you are installing them, like, are you using Bundler?) as well as which versions actually got installed. This looks very much like a basic dependency conflict; I don't think there is anything un-"clean" about how we are using the http gem, we are simply declaring a requirement for a recent version. It's possible that we made the requirement overly recent, that is, we might also be able to work with earlier versions, but I think that is probably a different issue. Webmock claims to be compatible with http 4.4.1 so this does not make a lot of sense to me.
By the way, I did try to reproduce this, but wasn't able to. What you wrote under "steps to reproduce" was very general; "Include both LD SDK gem and Webmock in the same project and run RSpec" would be enough if it were really true that any project using both gems would reproduce the problem, but that doesn't seem to be the case. So if you could provide a minimal project that demonstrates the error, that would be helpful.
Here's what I did:
Started with Ruby 2.5.9 on MacOS 10.15.7, with no gems installed except bundler 2.2.22 (and ffi, because there is a MacOS problem where you have to preinstall ffi in a particular way)
(Your wrote "the latest version of Webmock", which is 3.13.0 rather than 3.12.1, but it looks like 3.12.1 was what you were using so that's what I used.)
Ran bundle install successfully. I noted in the output that it installed version 4.4.1 of http.
Finished in 0.00024 seconds (files took 0.98972 seconds to load)
1 example, 0 failures
Based on the error output you showed, I would have expected this problem to happen as soon as it hit require "webmock", so it shouldn't matter whether the spec actually does anything.
Closing this issue because 1. we were not able to reproduce it and 2. it does not seem to be a problem with the SDK itself, but rather, that the developer is trying to use a test library that wants a very old version of http.
Activity
eli-darkly commentedon Jul 8, 2021
It seems likely that the issue here is not that the SDK isn't "cleanly interacting with the http gem", but that the SDK and webmock want two different versions of the http gem. This is a common issue in Ruby and really in any language that has a package manager, but it's largely outside of our control.
You can see in our gemspec that the SDK is requesting version "~>4.4.1" of http— that is, 4.4.1 or a higher compatible version.
And in Webmock's gemspec, there is a requirement for version ">=0.8.0" of http. That's a very broad requirement (0.8.0 was 6 years ago)— which would be fine if Webmock really were OK with any version greater than or equal to 0.8.0, but it seems like it is not.
From the information you provided, there's no way for me to know what version of http you actually have— which could also be affected by other dependencies in your project. If it were 4.4.1, I would not expect this error from Webmock because the specific failure that Webmock is having (not being able to find a
performmethod inHTTP::Client) doesn't make sense for any recent version of http, since theperformmethod does exist in those. (It does not exist in 0.8.0 though, so I don't know why they declared their requirement in that way; in other words, at first glance it looks to me like Webmock would not actually work with what they say is their minimum http version. But, due to our SDK's request for a higher version, I would not expect that such an old version would be loaded.)I can't really say more without being able to see the list of dependency gems/versions as they are declared in your project (and how you are installing them, like, are you using Bundler?) as well as which versions actually got installed. This looks very much like a basic dependency conflict; I don't think there is anything un-"clean" about how we are using the http gem, we are simply declaring a requirement for a recent version. It's possible that we made the requirement overly recent, that is, we might also be able to work with earlier versions, but I think that is probably a different issue. Webmock claims to be compatible with http 4.4.1 so this does not make a lot of sense to me.
eli-darkly commentedon Jul 8, 2021
By the way, I did try to reproduce this, but wasn't able to. What you wrote under "steps to reproduce" was very general; "Include both LD SDK gem and Webmock in the same project and run RSpec" would be enough if it were really true that any project using both gems would reproduce the problem, but that doesn't seem to be the case. So if you could provide a minimal project that demonstrates the error, that would be helpful.
Here's what I did:
Started with Ruby 2.5.9 on MacOS 10.15.7, with no gems installed except
bundler2.2.22 (andffi, because there is a MacOS problem where you have to preinstallffiin a particular way)Created this
Gemfile:(Your wrote "the latest version of Webmock", which is 3.13.0 rather than 3.12.1, but it looks like 3.12.1 was what you were using so that's what I used.)
Ran
bundle installsuccessfully. I noted in the output that it installed version 4.4.1 ofhttp.Created a minimal spec file
test.rb:bundle exec rspec test.rb.Based on the error output you showed, I would have expected this problem to happen as soon as it hit
require "webmock", so it shouldn't matter whether the spec actually does anything.Merge pull request #176 from launchdarkly/eb/sc-134212/move-file-data
eli-darkly commentedon Dec 9, 2021
Closing this issue because 1. we were not able to reproduce it and 2. it does not seem to be a problem with the SDK itself, but rather, that the developer is trying to use a test library that wants a very old version of
http.