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

bundler version restriction bundler (< 1.8.0, >= 1.5.2) ruby #5581

Closed
saifikhan opened this issue Apr 11, 2015 · 8 comments
Closed

bundler version restriction bundler (< 1.8.0, >= 1.5.2) ruby #5581

saifikhan opened this issue Apr 11, 2015 · 8 comments

Comments

@saifikhan
Copy link

Hi:
bundler install leads to bundler (< 1.8.0, >= 1.5.2) version restriction.

Bundler could not find compatible versions for gem "bundler":
In Gemfile:
vagrant (>= 0) ruby depends on
bundler (< 1.8.0, >= 1.5.2) ruby

Current Bundler version:
bundler (1.9.2)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running gem install bundler?
Could not find gem 'bundler (< 1.8.0, >= 1.5.2) ruby', which is required by gem 'vagrant (>= 0) ruby', in any of the sources.

What is the logic behind this restriction ?

@gildas
Copy link

gildas commented Apr 11, 2015

+1
I have the same issue, had to downgrade my bundler version in the rbenv I use.
It is just insane to have to prep a specific rbenv or rvm just for vagrant dev.

@sethvargo
Copy link
Contributor

Hi @saifikhan

I am sorry you are having issues. The recommended way to use Vagrant is via the official package installers.

The reason for this restriction is because Vagrant relies on some internal APIs in Bundler core that are not guaranteed to be backwards-compatible between minor version bumps (because they are internal APIs). Plugins in the Vagrant eco-system also leverage those APIs. There is an open PR to upgrade to Bundler 1.8, but we have not had time to rigorously test the upgrade yet.

Please let me know if you have any questions.

@gildas
Copy link

gildas commented Apr 13, 2015

@sethvargo, Yes, but if you are developing plugins, you really need to run vagrant in bundler, unless I missed something.

@sethvargo
Copy link
Contributor

@gildas correct, you will need bundler and the Vagrant source. You need to install a version of bundler that matches the constraints for Vagrant:

gem install bundler -v '~> 1.7.0'

@gildas
Copy link

gildas commented Apr 13, 2015

which is what I did. I was just saying, it's kinda annoying to do... a little...

@davidtrogers
Copy link

make sure you specify the patch version to stay within the bounds of the minor version:

$ gem install bundler -v '~> 1.7'
Fetching: bundler-1.9.4.gem (100%)
Successfully installed bundler-1.9.4
1 gem installed
$ bundler --version
Bundler version 1.9.4
$ gem install bundler -v '~> 1.7.0'
Fetching: bundler-1.7.14.gem (100%)
Successfully installed bundler-1.7.14
1 gem installed

@tknerr
Copy link
Contributor

tknerr commented Jun 1, 2015

Tried running it with bundler 1.7.15 on ruby 2.2.1 but got this stacktrace.

Guess there is a ruby / gems 2.2 incompatibility as well?

C:\Repos\_github\vagrant-toplevel-cookbooks>bundle install
Your Gemfile lists the gem vagrant-toplevel-cookbooks (>= 0) more than once.
You should probably keep only one of them.
While it's not a problem now, it could cause errors if you change the version of just one of them later.
Updating https://github.com/mitchellh/vagrant.git
Unfortunately, a fatal error has occurred. Please see the Bundler
troubleshooting documentation at http://bit.ly/bundler-issues. Thanks!
X:/tools/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.7.15/lib/bundler/settings.rb:175:in `normalize_uri': undefined local variable or method `mirror_source' for #<Bundler::Settings:0x00000003674988> (NameError)
        from X:/tools/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.7.15/lib/bundler/settings.rb:54:in `block in gem_mirrors'
        from X:/tools/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.7.15/lib/bundler/settings.rb:51:in `each'
        from X:/tools/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.7.15/lib/bundler/settings.rb:51:in `inject'
        from X:/tools/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.7.15/lib/bundler/settings.rb:51:in `gem_mirrors'
        from X:/tools/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.7.15/lib/bundler/source.rb:11:in `mirror_for'
        from X:/tools/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.7.15/lib/bundler/fetcher.rb:381:in `resolve_remote_uri'
        from X:/tools/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.7.15/lib/bundler/fetcher.rb:98:in `initialize'
        from X:/tools/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.7.15/lib/bundler/source/rubygems.rb:286:in `new'
        from X:/tools/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.7.15/lib/bundler/source/rubygems.rb:286:in `block in fetchers'
        from X:/tools/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.7.15/lib/bundler/source/rubygems.rb:285:in `map'
        from X:/tools/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.7.15/lib/bundler/source/rubygems.rb:285:in `fetchers'
        from X:/tools/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.7.15/lib/bundler/source/rubygems.rb:296:in `block in remote_specs'
        from X:/tools/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.7.15/lib/bundler/index.rb:9:in `build'
        from X:/tools/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.7.15/lib/bundler/source/rubygems.rb:295:in `remote_specs'
        from X:/tools/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.7.15/lib/bundler/source/rubygems.rb:77:in `specs'
...

@mitchellh
Copy link
Contributor

Fixed in master

hfm added a commit to hfm/itamae that referenced this issue Dec 27, 2015
Vagrant relies on some internal APIs in Bundler core.
The command of `bundle exec itamae ssh --vagrant` will conflict with Vagrant APIs.

Using `Bundler.with_clean_env` is necessary when using itamae with bundler.

* ref:
  * itamae-kitchen#185
  * hashicorp/vagrant#5581 (comment)
@ghost ghost locked and limited conversation to collaborators Apr 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants