Gem problems

Trying to use cabybara and aws’s ruby gem and I’m getting this error:

Bundler could not find compatible versions for gem “nokogiri”: In Gemfile: aws-sdk depends on nokogiri (~> 1.4.4) capybara depends on nokogiri (1.5.0)

Is there any way around this? Has anyone else had this problem

Have you installed both nokogiri versions to your machine ?

Brian Jakovich wrote in post #1013456:

No.

~> 1.4.4 means: >= 1.4.4 and < 1.5 1.5.0 means: = 1.5.0

So there's no way to have a single version of nokogiri that can simultaneously satisfy both version contraints.

-Rob

Rob Biedenharn Rob@AgileConsultingLLC.com http://AgileConsultingLLC.com/ rab@GaslightSoftware.com http://GaslightSoftware.com/

On Jul 28, 1:32 pm, Rob Biedenharn <R...@AgileConsultingLLC.com> wrot>

On Jul 28, 1:32 pm, Rob Biedenharn <R...@AgileConsultingLLC.com> wrot>

> >> Is there any way around this? Has anyone else had this problem

> No.

> ~> 1.4.4 means: >= 1.4.4 and < 1.5 > 1.5.0 means: = 1.5.0

> So there's no way to have a single version of nokogiri that can
> simultaneously satisfy both version contraints.

Other than forking aws-sdk, seeing if it is compatible with nokogiri 1.5 and if it is changing the version in the dependency

Hi Fred,

Can the OP not put the following in his gem file:

gem 'nokogiri', '~> 1.4.4', '1.5.0'

Would this not make both gem versions available to gems that require different versions of nokogiri?

I had two gems recently that required different versions of capybara, and a similar approach worked for me. If it's wrong, then I need to find out why it solved my issue, because my understanding of my problem is therefore wrong.

Paul

Hard to say without knowing exactly what your circumstances were, but at a basic level only one version of any given gem can be loaded at any single time

Fred

> Hi Fred,

> Can the OP not put the following in his gem file:

> gem 'nokogiri', '~> 1.4.4', '1.5.0'

> Would this not make both gem versions available to gems that require > different versions of nokogiri?

> I had two gems recently that required different versions of capybara, > and a similar approach worked for me. If it's wrong, then I need to > find out why it solved my issue, because my understanding of my > problem is therefore wrong.

Hard to say without knowing exactly what your circumstances were, but at a basic level only one version of any given gem can be loaded at any single time

I was having a problem getting cucumber to play nice with a current rails 3.0.9 project, (after running bundle update cucumber began failing everything, presumably due to now-conflicting gem versions), so I set up a few different gemsets in rvm and dummy projects for rails 3.0.5 thru' 3.0.9, and began adding gems to the gem files one by one to try and find out where I had gone wrong, and to try and understand what was going on with dependency versions etc.

I seem to remember one gem required capybara 0.4.0 and another required >= 0.4.1 for the 3.0.5 project.

Adding both versions for capybara as:

gem 'capybara', '>= 0.4.1', '~> 0.4.0'

fixed the problem, AFAIK.

I now have cucumber and rspec running fine in all three rails versions, only problem I have left relates to devise based scenarios which are failing when simulating clicking the sign in link, although manual clicking on the site is fine.

If I get the chance this weekend, I'll try digging deeper into the gem versions and dependencies, just thought it might have been a solution for the OP.

Paul

> Can the OP not put the following in his gem file:

> gem 'nokogiri', '~> 1.4.4', '1.5.0'

> Would this not make both gem versions available to gems that require > different versions of nokogiri?

> I had two gems recently that required different versions of capybara, > and a similar approach worked for me. If it's wrong, then I need to > find out why it solved my issue, because my understanding of my > problem is therefore wrong.

Hard to say without knowing exactly what your circumstances were, but at a basic level only one version of any given gem can be loaded at any single time

I seem to remember one gem required capybara 0.4.0 and another required >= 0.4.1 for the 3.0.5 project.

Adding both versions for capybara as:

gem 'capybara', '>= 0.4.1', '~> 0.4.0'

fixed the problem, AFAIK.

That line works because you are saying "I want a capybara gem that is greater than or equal to 0.4.1, AND which is greater than or equal to 0.4.0 and less than 0.5."

When you combine those conditions, you end up with "greater than or equal to 0.4.1, and less than 0.5." Which is fine because versions 0.4.2, 0.4.3, 0.4.4 etc. will all satisfy that condition.

On the other hand, this line:

gem 'nokogiri', '~> 1.4.4', '1.5.0'

is saying "I want a nokogiri that is greater than or equal to 1.4.4 and less than 1.5, AND which is equal to 1.5.0." No version can possibly be less than 1.5 AND be equal to 1.5 at the same time, so it's an invalid specification, since you can only have one version active at a time.

Chris