2

Given a gemfile of :

source 'https://rubygems.org'

gem 'rails', '4.1.1'

group :development, :test do
  gem 'railroady'
  gem 'sqlite3'
  gem 'jasmine'
  # For linux support
  gem 'therubyracer'
end

group :production do
  gem 'pg'
  gem 'thin'
end

gem 'sass-rails'
# gem 'coffee-rails'
gem 'uglifier', '>= 1.0.3'

gem 'colorize'
gem 'jquery-ui-rails'
gem 'jquery-rails'
gem 'rails-backbone'
# gem 'backbone-on-rails'
gem 'bootstrap-sass'
gem 'requirejs-rails', git: 'git://github.com/jwhitley/requirejs-rails.git'
gem 'ejs'
gem 'devise'
gem 'better_errors', '>= 0.2.0', :group => :development
gem 'binding_of_caller', '>= 0.6.8', :group => :development
gem 'd3_rails'
gem 'font-awesome-sass-rails'

# for a better way of looking at the rake routes by calling rake color_routes in the console
gem 'color_routes'
# lets us know which user is logged in, and store in a global variable gon{}
gem 'gon'
#browser detection
gem 'browser'

# FOR EASY TRANISTION TO Rails 4
gem 'protected_attributes'
gem 'rails-observers'
gem 'actionpack-page_caching'
gem 'actionpack-action_caching'

and when running bundle, getting the following error:

Bundler could not find compatible versions for gem "jquery-rails":
  In Gemfile:
    rails-backbone (>= 0) ruby depends on
      jquery-rails (~> 2.1.3) ruby

    jquery-rails (3.1.2)

Bundler could not find compatible versions for gem "ejs":
  In Gemfile:
    rails-backbone (>= 0) ruby depends on
      ejs (~> 1.0.0) ruby

    ejs (1.1.1)

Bundler could not find compatible versions for gem "rails":
  In Gemfile:
    rails-backbone (>= 0) ruby depends on
      rails (~> 3.1.0.beta1) ruby

    rails (4.1.1)

The errors aren't making sense. Taking the first part with jquery-rails, i get that it is saying another gem rails-backbone of a version greater than or equal to 0 depends on jquery-rails of around 2.1.3.

What does ruby mean after the versions? What is `jquery-rails (3.1.2) mean?

chris Frisina
  • 19,086
  • 22
  • 87
  • 167

3 Answers3

1

Basically, you have dependency errors in your gemfile, and it seems that rails-backbone is causing most of them, consider removing it, as the latest version works with rails 3.1 - it hasn't been updated for long time

Here is info about the gem: https://rubygems.org/gems/rails-backbone

Bundler could not find compatible versions for gem "ejs":
  In Gemfile:
    rails-backbone (>= 0) ruby depends on
      ejs (~> 1.0.0) ruby

    ejs (1.1.1)

This error literally means that you are using ejs version 1.1.1 (probably a dependency of some other gem), but rails-backbone (version greater or equal 0, so any version) requires ejs in version 1.0.*

you can use rails-backbone from the git with

gem 'rails-backbone', git: 'https://github.com/codebrew/backbone-rails.git', tag: 'v1.1.2'

Version 1.1.2 depends on any version of jquery-rails and mocha, so it shouldn't cause any problems. Using git without tag will get the latest version from master, but I would advise against using development version (may cause more trouble than good)

mswiszcz
  • 980
  • 1
  • 8
  • 26
0

The rubygem seems outdated, the github repository states that it works with rails 4

As a workaround, get the gem directly from github :

gem 'rails-backbone', :git => 'https://github.com/codebrew/backbone-rails.git'
jazzytomato
  • 6,994
  • 2
  • 31
  • 44
0

jquery-rails (~> 2.1.3) means it is dependent on all jquery-rails versions between 2.1.3 and below 2.2.0.

jquery-rails (3.1.2) is already installed in the app; it can be verified by looking at Gemfile.lock contents.

Try bundle update; it will try to update all the gem versions where there are no specific version specified, and possibly succeed in getting the dependency conflict resolved.

Prakash Murthy
  • 12,923
  • 3
  • 46
  • 74