I need to require these two gems in my Rails 3.2 app:
gem 'google-adwords-api'
gem 'netsuite'
However, they conflict on the versions of the savon gem. Bundler spits out this:
Bundler could not find compatible versions for gem "savon":
In Gemfile:
google-adwords-api (>= 0) ruby depends on
google-ads-common (~> 0.2.0) ruby depends on
savon (~> 0.9.1) ruby
netsuite (= 0.2.6) ruby depends on
savon (2.3.3)
I absolutely need both gems in my project, so this is what I've tried so far. I've moved the google-adwords-api gem into a custom Rails Engine I named "adx_interface" and mounted it within my Rails app. This engine has it's own Gemfile. If I put this line in my Rails app's Gemfile, then the Bundler error remains:
gem "adx_interface", "0.0.1", :path => "#{File.expand_path(__FILE__)}/../vendor/adx_interface"
Is there some way to namespace this engine so that it's dependencies aren't clashing with the apps dependencies? I've tried excluding the gem "adx_interface" line from the apps Gemfile, but that means I would have to start requiring gems manually instead of relying on Bundler. Is that a viable solution? If so, how do I go about including the google-adwords-api in such a way that it's namespaced properly and it's savon won't clash with netsuite's savon?
For what it's worth, I've personally contacted the author of the google-adwords-api gem. He said he likes the savon 0.9.1 gem and has no plans to ever update to a newer version.
What you are trying to do is exactly against the idea behind Bundler. Bundler exists to help you manage your dependencies and discover conflicts.
There is no clean way to bypass this restriction. The only solution I can think about, is to fork the google-adwords-api gem, bump the dependency and have your Gemfile to point to your custom fork.
Related
I've been trying to add the make_flaggable gem to my Rails project and have been getting the following error.
Bundler could not find compatible versions for gem "activerecord":
In Gemfile:
make_flaggable (>= 0) ruby depends on
activerecord (< 4.2, >= 3.0) ruby
rails (= 4.2.1) ruby depends on
activerecord (4.2.1)
I've tried bundle update and installing the gems in differing order, but neither of these get around the real issue.
Is the best way to get around this to fork the Gem and make my own copy without the < 4.2 dependency? Or is there another way to install make_flaggable without moving to an older version of Rails?
In the meanwhile, I've found a fork maintained by dgilperez that supports Rails 4.2.
https://github.com/dgilperez/make_flaggable.
Both of these gems, however, I have been unable to install successfully and seem unmaintained.
My app is working perfectly on my local machine but when I try to deploy/bundle update on heroku I get the following error that prevents from me from deploying.
Bundler could not find compatible versions for gem "mime-types":
In Gemfile:
rails (= 3.2.17) ruby depends on
mime-types (~> 1.16) ruby
stripe (>= 0) ruby depends on
mime-types (2.3)
Running bundle update shows that I am using mime-types 1.25.1. From the error message it seems that ruby stripe would need 2.3, though if that's the case shouldn't it, as a dependency be updated to 2.3?
Thanks in advance for your time.
This related SO question about gem dependency conflicts with Rails depending on old mime-types mentions a syntax for specifying that multiple versions of a dependency are acceptable.
You may be in luck because Stripe just released v1.15.0 which relaxes the mime-type gem requirement in this commit.
The dependency from Stripe is now (greater than or equal to 1.25, or under 3) - whereas in your extract it's requiring version 2.3:
s.add_dependency('mime-types', '>= 1.25', '< 3.0')
And from your excerpt above Rails 3.2.17 needs 1.16 or above, of a 1.x version.
So if you specify you need Stripe v1.15.0 or greater this may fix your issue.
gem 'stripe', ~> 1.15
I'm trying to install a the instagram-ruby-gem but bundler keeps failing with this error:
Bundler could not find compatible versions for gem "faraday":
In Gemfile:
instagram (>= 0) ruby depends on
faraday (< 0.9, >= 0.7.4) ruby
instagram (>= 0) ruby depends on
faraday (0.9.0)
Here's my Gemfile:
gem 'instagram', git: 'https://github.com/larrylv/instagram-ruby-gem.git'
I am using this specific fork because it fixes the faraday version to be compatible with Rails 4. See the commit here, but here's the change:
- s.add_runtime_dependency('faraday', ['>= 0.7', '< 0.9'])
+ s.add_runtime_dependency('faraday', '>= 0.7.4', '<= 0.9.0')
I already tried bundle update. That did not work. The only faraday version installed is faraday 0.9.0.
I downloaded the forked gem, built it and then installed it. It looks like it went through without any issues on my end. So it is something to do with the environment or a gem conflict issue. I'd check to make sure you don't have any other versions of the gem installed. Do you use RVM by any chance and use gemsets with RVM? As a last resort you could delete the Gemfile.lock, but that is not really recommended. You could look at the Gemfile.lock file as well and look at the faraday references. Perhaps other gems need a certain version and the forked gem you use requires another version? I have run in to that before. It is not fun to try and resolve.
Mike Riley
I created a new app in Refinery CMS and followed the instructions according to their guide. http://refinerycms.com/download
But when I go to run rails server, I get errors about gem dependencies. Normally those are easy to fix. But what to do when you have conflicting dependencies? This is one of the errors that I got
Bundler could not find compatible versions for gem "refinerycms-core":
In Gemfile:
refinerycms-blog (~> 2.0.0) ruby depends on
refinerycms-core (~> 2.0.0) ruby
refinerycms (~> 2.1.0) ruby depends on
refinerycms-core (2.1.0)
when I have ran into this problem in the past and I added the specific gem, it then would still give me an error saying that it needed the other gem as well. What am I doing wrong here?
Got a response on Twitter from the people at refinery who sent me this link
https://github.com/refinery/refinerycms/issues/2386#issuecomment-22978992
which says so change the gem to
gem 'refinerycms-blog', github: 'refinery/refinerycms-blog', branch: 'master'
Trying to test out this awesome looking gem - http://icelab.com.au/articles/welcome-to-the-omnisocial/ - that promises easy integration of Twitter & FB login to my app.
But, when I run bundle install I see this:
Bundler could not find compatible versions for gem "bcrypt-ruby":
In Gemfile:
omnisocial depends on
bcrypt-ruby (~> 2.1)
bcrypt-ruby (3.0.0)
When I specify that I want Bundler to use version 2.1, I get this:
Bundler could not find compatible versions for gem "bcrypt-ruby":
In Gemfile:
bcrypt-ruby (~> 2.1)
rails (= 3.1.0) depends on
bcrypt-ruby (3.0.0)
So now I have to choose between either Omnisocial or Rails 3.1. Seems like such a crappy choice.
What do I do to get it to work?
I've pushed released a new version of the gem (which I've had to rename to omnipopulus for legal reasons). This new release doesn't depend on any particular version of the bcrypt-ruby gem, so you should be fine to run it with Rails 3.1.
Add this to your Gemfile to get going:
gem 'omnipopulus'
Then run bundle and follow the instructions in the README at https://github.com/icelab/omnipopulus
Make sure that you've removed any references to omnisocial in your app.
The current github version of omnisocial requires no particular version of bcrypt. See here.
But they added a dependency to a RC version of Rails...
What I often do in these cases:
clone the github repository
change what I need
run the gem's test suite
if ok, add my own version to the Rails app
if a new version of the gem is released an fit my needs, I use the official version again