Bundle update issues with chef11.4.4, berkshelf2.0.4 and json


#1

New to ruby/gems so I might be doing something dumb here… but

I get the following error when running “bundle update”

Bundler could not find compatible versions for gem “json”:
In Gemfile:
chef (= 11.4.4) ruby depends on
json (<= 1.7.7, >= 1.4.4) ruby

berkshelf (= 2.0.4) ruby depends on
  json (1.8.0)

With a gem file of


source ‘https://rubygems.org

ruby ‘1.9.3’

gem ‘rake’, '10.0.4’
gem ‘berkshelf’, '2.0.4’
gem “chefspec”, “1.3.1”

group :development do
gem ‘chef’, '11.4.4’
gem ‘guard’, '1.8.1’
end

I’ve looked over the Gemfiles of berkshelf and chef and none declare json directly, so I assume its some bundle trail…? Is there an easy solution to this that I can declare in the Gemfile?

I have done a manual gem install of json and gem list shows I have 1.8 and 1.7, but bundle still isn’t happy.


#2

One thing I’ve found useful is to specifiy the json gem in the gemfile
for this problem.

gem ‘json’, ‘~> 1.7.7’

-M

On Thu, Jun 20, 2013 at 4:39 PM, Kyle Sloan ksloan@2dialog.com wrote:

New to ruby/gems so I might be doing something dumb here… but

I get the following error when running “bundle update”

Bundler could not find compatible versions for gem “json”:
In Gemfile:
chef (= 11.4.4) ruby depends on
json (<= 1.7.7, >= 1.4.4) ruby

berkshelf (= 2.0.4) ruby depends on
  json (1.8.0)

With a gem file of


source ‘https://rubygems.org

ruby ‘1.9.3’

gem ‘rake’, '10.0.4’
gem ‘berkshelf’, '2.0.4’
gem “chefspec”, “1.3.1”

group :development do
gem ‘chef’, '11.4.4’
gem ‘guard’, '1.8.1’
end

I’ve looked over the Gemfiles of berkshelf and chef and none declare json directly, so I assume its some bundle trail…? Is there an easy solution to this that I can declare in the Gemfile?

I have done a manual gem install of json and gem list shows I have 1.8 and 1.7, but bundle still isn’t happy.


#3

Thanks, this is now getting bundle to install without complaints.

On Jun 20, 2013, at 4:32 PM, Mike miketheman@gmail.com wrote:

One thing I’ve found useful is to specifiy the json gem in the gemfile
for this problem.

gem ‘json’, ‘~> 1.7.7’

-M

On Thu, Jun 20, 2013 at 4:39 PM, Kyle Sloan ksloan@2dialog.com wrote:

New to ruby/gems so I might be doing something dumb here… but

I get the following error when running “bundle update”

Bundler could not find compatible versions for gem “json”:
In Gemfile:
chef (= 11.4.4) ruby depends on
json (<= 1.7.7, >= 1.4.4) ruby

berkshelf (= 2.0.4) ruby depends on
json (1.8.0)

With a gem file of


source ‘https://rubygems.org

ruby ‘1.9.3’

gem ‘rake’, '10.0.4’
gem ‘berkshelf’, '2.0.4’
gem “chefspec”, “1.3.1”

group :development do
gem ‘chef’, '11.4.4’
gem ‘guard’, '1.8.1’
end

I’ve looked over the Gemfiles of berkshelf and chef and none declare json directly, so I assume its some bundle trail…? Is there an easy solution to this that I can declare in the Gemfile?

I have done a manual gem install of json and gem list shows I have 1.8 and 1.7, but bundle still isn’t happy.


#4

Hey Kyle,

I’d be careful when putting Chef and Berkshelf in the same Gemfile. It’s not guaranteed to work because both of these gems are “applications” and not designed to be loaded within the same Ruby VM.

It’s recommended that you install Berkshelf with the gem command when possible!


Jamie Winsor
@resetexistence

On Thursday, June 20, 2013 at 2:40 PM, Kyle Sloan wrote:

Thanks, this is now getting bundle to install without complaints.

On Jun 20, 2013, at 4:32 PM, Mike <miketheman@gmail.com (mailto:miketheman@gmail.com)> wrote:

One thing I’ve found useful is to specifiy the json gem in the gemfile
for this problem.

gem ‘json’, ‘~> 1.7.7’

-M

On Thu, Jun 20, 2013 at 4:39 PM, Kyle Sloan <ksloan@2dialog.com (mailto:ksloan@2dialog.com)> wrote:

New to ruby/gems so I might be doing something dumb here… but

I get the following error when running “bundle update”

Bundler could not find compatible versions for gem “json”:
In Gemfile:
chef (= 11.4.4) ruby depends on
json (<= 1.7.7, >= 1.4.4) ruby

berkshelf (= 2.0.4) ruby depends on
json (1.8.0)

With a gem file of


source ‘https://rubygems.org

ruby ‘1.9.3’

gem ‘rake’, '10.0.4’
gem ‘berkshelf’, '2.0.4’
gem “chefspec”, “1.3.1”

group :development do
gem ‘chef’, '11.4.4’
gem ‘guard’, '1.8.1’
end

I’ve looked over the Gemfiles of berkshelf and chef and none declare json directly, so I assume its some bundle trail…? Is there an easy solution to this that I can declare in the Gemfile?

I have done a manual gem install of json and gem list shows I have 1.8 and 1.7, but bundle still isn’t happy.


#5

Cool, thanks for the tip. I’ll update my setup to make this part of stuff to do along with downloading and installing virtual box, rvm, and vagrant.

On Jun 20, 2013, at 6:35 PM, Jamie Winsor jamie@vialstudios.com wrote:

Hey Kyle,

I’d be careful when putting Chef and Berkshelf in the same Gemfile. It’s not guaranteed to work because both of these gems are “applications” and not designed to be loaded within the same Ruby VM.

It’s recommended that you install Berkshelf with the gem command when possible!


Jamie Winsor
@resetexistence
https://github.com/reset


#6

Jamie Winsor jamie@vialstudios.com writes:

Hey Kyle,

I’d be careful when putting Chef and Berkshelf in the same Gemfile.
It’s not guaranteed to work because both of these gems are
"applications" and not designed to be loaded within the same Ruby VM.

It’s recommended that you install Berkshelf with the gem command when
possible!

Being fairly new to Ruby myself, how do you handle this when e.g. both
Berkshelf and Chef needs dependencies and both are applications?

While they don’t need to be in the same VM, they preferably need to
work within the same directory structure (ie berks and knife commands)

/Jeppe


#7

While I might not be the best person to answer, I think you want to use something like rvm https://rvm.io or rbevn https://github.com/sstephenson/rbenv

I am currently using rvm.

On Jun 21, 2013, at 5:43 AM, Jeppe Nejsum Madsen jeppe@ingolfs.dk wrote:

Jamie Winsor jamie@vialstudios.com writes:

Hey Kyle,

I’d be careful when putting Chef and Berkshelf in the same Gemfile.
It’s not guaranteed to work because both of these gems are
"applications" and not designed to be loaded within the same Ruby VM.

It’s recommended that you install Berkshelf with the gem command when
possible!

Being fairly new to Ruby myself, how do you handle this when e.g. both
Berkshelf and Chef needs dependencies and both are applications?

While they don’t need to be in the same VM, they preferably need to
work within the same directory structure (ie berks and knife commands)

/Jeppe


#8

Kyle Sloan ksloan@2dialog.com writes:

While I might not be the best person to answer, I think you want to use something like rvm https://rvm.io or rbevn https://github.com/sstephenson/rbenv
I am currently using rvm.

I’m already using rbenv, but can’t really see how this solves the problem of
having two apps (with different dependencies) in the same working dir?

But maybe I’m missing something :slight_smile:

/Jeppe

On Jun 21, 2013, at 5:43 AM, Jeppe Nejsum Madsen jeppe@ingolfs.dk wrote:

Jamie Winsor jamie@vialstudios.com writes:

Hey Kyle,

I’d be careful when putting Chef and Berkshelf in the same Gemfile.
It’s not guaranteed to work because both of these gems are
"applications" and not designed to be loaded within the same Ruby VM.

It’s recommended that you install Berkshelf with the gem command when
possible!

Being fairly new to Ruby myself, how do you handle this when e.g. both
Berkshelf and Chef needs dependencies and both are applications?

While they don’t need to be in the same VM, they preferably need to
work within the same directory structure (ie berks and knife commands)

/Jeppe


#9

On Mon, Jun 24, 2013 at 9:29 AM, Jeppe Nejsum Madsen jeppe@ingolfs.dkwrote:

Kyle Sloan ksloan@2dialog.com writes:

While I might not be the best person to answer, I think you want to use
something like rvm https://rvm.io or rbevn
https://github.com/sstephenson/rbenv
I am currently using rvm.

I’m already using rbenv, but can’t really see how this solves the problem
of
having two apps (with different dependencies) in the same working dir?

But maybe I’m missing something :slight_smile:

Unless you are integrating Chef or Berkshelf into a larger application,
just do not use Bundler–that will solve it :slight_smile:


#10

On Mon, Jun 24, 2013 at 10:11 AM, Andrea Campi <andrea.campi@zephirworks.com

wrote:

On Mon, Jun 24, 2013 at 9:29 AM, Jeppe Nejsum Madsen jeppe@ingolfs.dkwrote:

Kyle Sloan ksloan@2dialog.com writes:

While I might not be the best person to answer, I think you want to use
something like rvm https://rvm.io or rbevn
https://github.com/sstephenson/rbenv
I am currently using rvm.

I’m already using rbenv, but can’t really see how this solves the problem
of
having two apps (with different dependencies) in the same working dir?

But maybe I’m missing something :slight_smile:

Unless you are integrating Chef or Berkshelf into a larger application,
just do not use Bundler–that will solve it :slight_smile:

Even if Chef & Berkshelf uses different versions of json?

/Jeppe