3
votes

Trying to install ActiveAdmin on a Rails 4 project, and am getting this error:

Bundler could not find compatible versions for gem "activerecord":
  In Gemfile:
    activeadmin (>= 0) ruby depends on
      activerecord (~> 3.0) ruby

    rails (= 4.0.0) ruby depends on
      activerecord (4.0.0)

I've followed this example: Active admin install with Rails 4 and added activeadmin to the gemfile like so:

gem 'activeadmin', github: 'gregbell/active_admin', branch: 'rails4'

But still no go; same error.

3
AA is working well with Rails 4, see my answer here : stackoverflow.com/a/17965030/978728Erowlin

3 Answers

1
votes

Ah my mistake; I thought I didn't have to include all the others since I wasn't using them; but it's not ActiveAdmin that is having a problem with ActiveRecord but something that AA depends on:

https://github.com/gregbell/active_admin/issues/2322

1
votes

It depends on which version you are using Rails 4.1 or 4.0.

If yo are using Rails 4.0.X just use master and you are ready to go:

gem 'activeadmin', github: 'gregbell/active_admin'

For Rails 4.1 you should use master and the following dependency branches:

gem 'activeadmin', github: 'gregbell/active_admin'

gem 'polyamorous', github: 'activerecord-hackery/polyamorous'

gem 'ransack', github: 'activerecord-hackery/ransack'

gem 'formtastic', github: 'justinfrench/formtastic'

After that just

bundle install (or bundle update, if necessary)

and run

rails generate active_admin:install (if necessary) to install

0
votes

Use gem 'activeadmin', github: 'gregbell/active_admin' in Gemfile