Search code examples
jqueryruby-on-rails-3ujs

Which jquery-rails gem version is working with Rails 3.0?


According to the docs, the jquery-ujs Installation is as easy as adding

gem 'jquery-rails', '~> 2.1'

to the Gemfile, and running:

$ bundle install

My app is running Rails 3.0.15, and jquery-rails seems to be compatible with it:

For Rails 3.0 , run [...]

but when bundling jquery-rails 2.1, I seem to need Rails 3.1+:

Bundler could not find compatible versions for gem "railties":
  In Gemfile:
    jquery-rails (~> 2.1) x86-mingw32 depends on
      railties (< 5.0, >= 3.1.0) x86-mingw32

    rails (= 3.0.15) ruby depends on
      railties (3.0.15)

What jquery-rails gem version is compatible with Rails 3.0?

(also asked here)


Solution

  • When trying an earlier version of the gem

    `gem 'jquery-rails', '2.0.2'`
    

    the dependency is even higher:

      In Gemfile:
        jquery-rails (= 2.0.2) ruby depends on
          railties (< 5.0, >= 3.2.0) ruby
    

    So for Rails 3.0.15 I ended up taking out the version from the Gemfile altogether and ended up with version 1.0.19.

    Installing jquery-rails (1.0.19)