Has anyone seen these errors?

Hi everyone,

Has anyone seen the following issues and if so how did you resolve them?

Bundler could not find compatible versions for gem “bundler”:

In Gemfile:

rails (= 4.2.4) was resolved to 4.2.4, which depends on

  bundler (>= 1.3.0, < 2.0)

Current Bundler version:

bundler (2.0.1)

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.3.0, < 2.0)’, which is required by gem 'rails

(= 4.2.4)’, in any of the sources.

Bundler could not find compatible versions for gem “coffee-rails”:

In Gemfile:

coffee-rails (~> 4.1.0)

rails_admin was resolved to 1.4.2, which depends on

  coffee-rails (~> 4.0)

Bundler could not find compatible versions for gem “jwt”:

In Gemfile:

jwt

opentok was resolved to 2.4.0, which depends on

  jwt (~> 1.5.6)

twilio-ruby was resolved to 5.21.1, which depends on

  jwt (>= 1.5, <= 2.5)

Bundler could not find compatible versions for gem “rails”:

In Gemfile:

rails (= 4.2.4)

griddler was resolved to 1.5.2, which depends on

  rails (>= 3.2.0)

moonclerk was resolved to 1.0.3, which depends on

  rails (>= 4.1)

rails_admin was resolved to 1.4.2, which depends on

  rails (>= 4.0, < 6)

Bundler could not find compatible versions for gem “ruby”:

In Gemfile:

ruby (~> 2.3.8.0)

active_record-acts_as was resolved to 4.0.0, which depends on

  ruby (>= 2.4)

Try bundle update.

It sounds like you want to run bundle update to get your gems to update in concert. There are a lot of options in this area of bundler; read the docs, or browse bundle update --help in the console to see what you can do. Definitely make sure you have a new git branch if you start running this without the brakes on. It is very easy to end up with a whole cluster of changes that are difficult to resolve, particularly if you haven't done this in a while.

Walter

Hi David and Walter and everyone else,

I ran the bundle update and now here is what seems to be the issue:

Bundler could not find compatible versions for gem “bundler”:

In Gemfile:

rails (= 4.2.4) was resolved to 4.2.4, which depends on

  bundler (>= 1.3.0, < 2.0)

Current Bundler version:

bundler (2.0.1)

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.3.0, < 2.0)’, which is required by gem 'rails

(= 4.2.4)’, in any of the sources.

Bundler could not find compatible versions for gem “coffee-rails”:

In Gemfile:

coffee-rails (~> 4.1.0)

rails_admin was resolved to 1.4.2, which depends on

  coffee-rails (~> 4.0)

Bundler could not find compatible versions for gem “jwt”:

In Gemfile:

jwt

opentok was resolved to 2.4.0, which depends on

  jwt (~> 1.5.6)

twilio-ruby was resolved to 5.21.1, which depends on

  jwt (>= 1.5, <= 2.5)

Bundler could not find compatible versions for gem “rails”:

In Gemfile:

rails (= 4.2.4)

griddler was resolved to 1.5.2, which depends on

  rails (>= 3.2.0)

moonclerk was resolved to 1.0.3, which depends on

  rails (>= 4.1)

rails_admin was resolved to 1.4.2, which depends on

  rails (>= 4.0, < 6)

Bundler could not find compatible versions for gem “ruby”:

In Gemfile:

ruby (~> 2.3.8.0)

active_record-acts_as was resolved to 4.0.0, which depends on

  ruby (>= 2.4)

Someone else answered this already. Use the _underscore_ trick to force a particular version of bundler to run the command:

bundle _2.0.0_ update ...

See if that works.

Walter

Hi Walter,

That is what I ran that gave me the latest set of errors that you see. What I am trying to do now is figure out how to eliminate the errors so it is clean.

Thanks,

Okay. Do you know how to figure out which versions you have installed?

gem list bundler

will show you a list of the currently installed versions of the gem. You can install any particular version you want, or if you find one that is in the range you noted in the error message, use that in place of _2.0.0_.

Walter

Walter is right.

bundler (2.0.1) is what is being reported as doing the Update, but that conflicts with the version required by the Gemfile:

rails (= 4.2.4) was resolved to 4.2.4, which depends on

bundler (>= 1.3.0, < 2.0)

In other words you need some form of Bundler 1.X installed to manage the version conflicts you’re seeing.

The installed bundlers are as folllows bundler (2.0.1, default: 1.17.3, 1.11.2).

.

Great, so have you tried this yet?

bundle 1.17.3 update

As an aside, always run bundle, rake, rails apps from within your rails app’s bin/ directory… letting PATH find and run an arbitrary script can yield some strange results sometimes. (Also make sure that the sha-bang line of those scripts in the bin/ are also pointing to the right ruby executable, if you have more than one installed on your system.)

Hope this helps.

Phil

Hi Brandon and Walter,

Running 1.17.3 here are the latest:

Using i18n 0.9.5

Fetching json 1.8.6

Installing json 1.8.6 with native extensions

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:

/var/lib/gems/2.3.0/gems/json-1.8.6/ext/json/ext/generator

/usr/bin/ruby2.3 -I /usr/local/lib/site_ruby/2.3.0 -r

./siteconf20190307-6909-kq64kq.rb extconf.rb

mkmf.rb can’t find header files for ruby at /usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/2.3.0/gems/json-1.8.6 for

inspection.

Results logged to

/var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/json-1.8.6/gem_make.out

An error occurred while installing json (1.8.6), and Bundler cannot

continue.

Make sure that gem install json -v '1.8.6' --source '[https://rubygems.org/](https://rubygems.org/)'

succeeds before bundling.

In Gemfile:

griddler-mailgun was resolved to 1.1.1, which depends on

griddler was resolved to 1.5.2, which depends on

  rails was resolved to 4.2.4, which depends on

    actionmailer was resolved to 4.2.4, which depends on

      actionpack was resolved to 4.2.4, which depends on

        actionview was resolved to 4.2.4, which depends on

          rails-dom-testing was resolved to 1.0.9, which depends on

rails-deprecated_sanitizer was resolved to 1.0.3, which depends

on

              activesupport was resolved to 4.2.4, which depends on

                json

Let me know your thoughts. Thank you so much.

Wow thanks Phil

I think I went back to the Rails5.2.2 gem and used this version of Rails. Also I didn’t specify the Ruby gem just used the default one.

Hi David,

Thank you for the insight. This started as an older Rails project. I am trying to manually install json 1.8.6 and am getting the following error:

Building native extensions. This could take a while…

ERROR: Error installing json:

ERROR: Failed to build gem native extension.

Thanks

Try looking at the doc for the Jason gem. Check for dependencies. Falling that ask Walter.

Once I installed Ruby-Dev it cleared up the issues I ran into.

sudo apt-get install ruby-dev.

I wanted to thank everyone for their input and assistance. Thank you kindly.

Thanks for letting us know

Always. :wink: