I'm getting this error after bundle install. How can I fix it?
Bundler could not find compatible versions for gem "excon":
In Gemfile:
locomotive-heroku (~> 0.0.2) ruby depends on
excon (~> 0.9.4) ruby
excon (0.20.0)
Uninstall the latest version of the gem: gem uninstall excon -v=0.20.0. Then bundle install again to see if it resolved the problem.
i fixed it by putting the locations for the current repos for locomotive/engine and locomotive/heroku. I.e gem 'locomotive-heroku', git: 'repolocation', require: 'locomotive/heroku' This is also what eventually got me a working installation of locomotivecms on heroku. I did need to set it to compile assets in the production environment.
Related
I'm trying to upgrade to latest haml gem. Here is the part of the Gemfile:
gem "haml", "~> 4.0.2"
gem "haml-rails", "~> 0.4", :group => :development
However, it seems that another gem:
gem "dj_mon", "~> 1.1.0"
requires an older version of haml. So when I run bundle update, I get:
Bundler could not find compatible versions for gem "haml":
In Gemfile:
dj_mon (~> 1.1.0) ruby depends on
haml (~> 3.1) ruby
haml (4.0.2)
Any idea on how to fix this?
You have a dependency conflict. I'm not an expert on this, but it seems to me you have two choices:
Update to the latest version of haml which is compatible with dj_mon (I think 3.1.8), and then wait until the maintainers of the gem update its dependencies, at which point the conflict is gone.
If you really want to use the latest version of haml, then you could fork the dj_mon gem, update the dependency, run the tests for the gem and if all goes well, you can just replace the dependency with your forked version for the time being.
Hope that helps.
I have 1.9.2 Ruby installed in RVM. When I do a gem list I get this:
bundler (1.1.3)
When I try to remove it I get:
gem uninstall bundler
INFO: gem "bundler" is not installed
When I try to run bundle install for my app I get:
Bundler could not find compatible versions for gem "bundler":
In Gemfile:
rails (= 3.0.1) ruby depends on
bundler (~> 1.0.0) ruby
Current Bundler version:
bundler (1.1.3)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?
I have tried uninstalling 1.9.2 but that did not help.
Found the answer in another Stack thread but closed it without noting the link. The issue is that rvm will not let you uninstall gems from a custom gemset that are still a part of the default "global" gemset. Do a rvm gemset use global then uninstall 1.1.3 from global.
Running 'sudo gem uninstall' did the trick for me. It seems that 'gem uninstall' will sometimes "lie" when not running as sudo.
I wonder if anybody has the following issue:
in a jruby environment, I can do:
gem install glassfish
no problem
But if I add
gem 'glassfish'
to my Gemfile and do
bundle install
it always complain glass fish gem cannot be found.
Any solution to this? Thanks
Do you have source "http://rubygems.org" in your Gemfile? I just tested
source "http://rubygems.org"
gem 'glassfish'
and it was fine:
$ cat > Gemfile
source 'http://rubygems.org'
gem "glassfish"
$ jruby -S bundle install
Fetching source index for http://rubygems.org/
Using rack (1.3.5)
Installing glassfish (1.0.3)
Using bundler (1.0.21)
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
Having said that, please keep in mind that glassfish gem is not maintained at this time. For the alternatives, please check this blog post: http://www.engineyard.com/blog/2011/taking-stock-jruby-web-servers/
It turned out to be something wrong with the Gemfile.lock. deleted the file and reinstall fixed the issue.
When I run bundle install after adding the omnisocial gem to my gem file, I get this when I have in fact already installed the latest version of the oa-core gem:
Bundler could not find compatible versions for gem "oa-core":
In Gemfile:
omnisocial depends on
oa-core (~> 0.1.2)
omniauth depends on
oa-core (0.2.6)
...
gem install oa-core
Successfully installed oa-core-0.2.6
1 gem installed
Installing ri documentation for oa-core-0.2.6...
Installing RDoc documentation for oa-core-0.2.6...
Do I need to update my version of rails?
The problem is that the omnisocial gem's dependencies have not been updated to match the latest oa-core release. Bundler will attempt to resolve all the dependencies for all the gems.
In this situation, omnisocial says it is quite happy with any of the 0.1.x releases (as long as it's the 0.1.2 release or one after that) of oa-core (this is what the ~> operator means) but omniauth says it must have 0.2.6. Obviously, 0.2.6 is not a part of the 0.1.x set of releases and so you are getting this error.
omnisocial's gem dependencies must be upgraded to match the latest oa-core version. That is the problem.
Alternatively, you could use omniauth which is designed to work with this latest version of the oauth suite, rather than using omnisocial.
I've added a gem 'koala' to my Gemfile and seems to have thrown gem versions out of whack when I run the 'bundle install' command:
Bundler could not find compatible versions for gem "faraday":
In snapshot (Gemfile.lock):
faraday (0.6.1)
In Gemfile:
koala (~> 1.2.0beta1) depends on
faraday (~> 0.7.4)
Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
How can I resolve this conflict?
Delete the contents of Gemfile.lock, and run bundle install again. That's been working for me.
Did you run bundle update as the error message points out? bundle install handles changes to the Gemfile and bundle update upgrades gems that are already managed by Bundler. The Gemfile.lock file locks in version numbers, bundle update will update any of those that aren't directly specified in your Gemfile (like gem 'rails', '3.0.9').
Deleting the Gemfile.lock will work, but running bundle update is better.
You can't simply delete you Gemfile.lock if that is a solution then why Gemfile.lock is exist in the first place, you code depend on the versions locked in this file, try to only update the Gem which cause the conflict by using bundle update gem_name and you have to check the ReadMe if any changes needed to work with the new version otherwise you are breaking your code or others code.
I found that by removing the specified version of rails solved the problem for me ....
instead of:
gem rails, '4.0.4'
I did
gem rails
followed by deleting the Gemfile.lock and re-running bundle install
If deleting Gemfile.lock doesn't work there is another possibility:
It may be possible a gem you are depending on has inadvertently included its own Gemfile.lock in its .gem file. The solution is to update the offending gems to not include a Gemfile.lock, rebuild and reinstall.
An alternative is to go to your Gemfile.lock and delete all references to the offending gem (in this case the faraday gem).
Then run bundle install and it'll update the Gemfile.lock to have compatible versions of the gem where it needs.
If you want to be extra safe you can go to the Gemfile and specify the versions of the gems you want before doing this.
This was the only way I was able to get bundle install running for one of the systems that I'm maintaining.
This system has a lot of old gems in its dependencies (58 gems at the time of writing) and so bundler has a hard time coping with it.
If I delete the Gemfile.lock and run bundle install it'll blow up with multiple Bundler could not find compatible versions for gem xxxxxx errors.
If I run bundle update it would also blow up with multiple Bundler could not find compatible versions for gem xxxxxx errors.
Note: Removing Gemfile.lock will have new entried to different gems. This might not be acceptable in your project. Your team or lead will not allow this.
If you are working on legacy codebase, for example Rails 3.2 or similar
In case you hit this kind of errors,
see the last line of Gemfile.lock which seems like
whenever (~> 0.9.4)
wicked_pdf (= 1.1.0)
will_paginate (= 3.1.8)
wkhtmltopdf-binary-edge (~> 0.12.4.0)
BUNDLED WITH
1.16.6
now install the version of bundler mentioned in the file. In my case its1.16.6.
gem install bundler -v 1.16.6
now remove the older version. How?
$ gem uninstall bundler
Select gem to uninstall:
1. bundler-1.16.6
2. bundler-2.1.4
3. All versions
> 2
Successfully uninstalled bundler-2.1.4
$ bundle -v
Bundler version 1.16.6
Now it will install successfully