81

I got this error when installing active admin on Rails 4

Bundler could not find compatible versions for gem "actionpack":
In Gemfile:
  meta_search (>= 1.1.0.pre) ruby depends on
    actionpack (~> 3.1.0.alpha) ruby

  rails (= 4.0.0.rc1) ruby depends on
    actionpack (4.0.0.rc1)

I follow this instruction: http://www.activeadmin.info/docs/documentation.html

Anyone help please.

Taryn East
  • 27,486
  • 9
  • 86
  • 108
Md Sirajus Salayhin
  • 4,974
  • 5
  • 37
  • 46

5 Answers5

229

Apr 20, 2015 update

For Rails 4 (according to the official github page) use either master:

gem 'activeadmin', github: 'activeadmin'

Or rubygems:

gem 'activeadmin', '~> 1.0.0.pre1'

Feb 14, 2015 update

For Rails 4 (according to the official github page) use:

gem 'activeadmin', github: 'activeadmin'

Sept 4, 2014 update

For Rails 4.0 and 4.1 (according to the official github page) use:

gem 'activeadmin', github: 'activeadmin'

April 24, 2014 update

For Rails 4.1 and 4.0 use master:

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

April 13, 2014 update

For Rails 4.1 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'

For Rails 4.0.X just use master and you should be good to go:

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

Note: There's an issue with adding comments to the index page in Rails 4.1. This issue is being tracked here.

September 29, 2013 update

The Rails 4 branch has been merged into master. Now all you need to do is specify:

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

August 28, 2013 Updated answer

Was able to build a new rails 4 app up and running with AA just using:

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

Please disregard the older answer. Just add this line to your new rails 4 app Gemfile, run bundle install, run rails g active_admin:install, run rake db:migrate, run bundle exec rails s, go to /admin, and log in with admin@example.com/password and you're good to go! See ActiveAdmin Documentation for more details.

June 30, 2013 Updated answer

Much progress has been made on getting ActiveAdmin and the gems it depends on ready for Rails 4. Please use the following gemfile settings and disregard the bit regarding downgrading jquery-rails to 2.3.0:

gem 'devise',              github: 'plataformatec/devise'
gem 'responders',          github: 'plataformatec/responders'
gem 'inherited_resources', github: 'josevalim/inherited_resources'
gem 'ransack',             github: 'ernie/ransack'
gem 'activeadmin',         github: 'gregbell/active_admin', branch: 'rails4'
gem 'formtastic',          github: 'justinfrench/formtastic'

just bundle install (or bundle update, if necessary) and run rails generate active_admin:install (if necessary) to install


Original Answer

I used the following to get ActiveAdmin on my Rails 4.0.0.rc1/JRuby/Puma app up and running on Heroku.

After checking out the following links from the ActiveAdmin github:

Re: Rails 4 problems - Issue #1963

Rails 4 Hacks, Fixes - Pull Request #2120

I added the following to my gemfile:

gem 'devise',              github: 'plataformatec/devise',     branch: 'rails4'
gem 'responders',          github: 'plataformatec/responders'
gem 'inherited_resources', github: 'josevalim/inherited_resources'
gem 'ransack',             github: 'ernie/ransack'
gem 'activeadmin',         github: 'akashkamboj/active_admin', branch: 'rails4'
gem 'formtastic',          github: 'justinfrench/formtastic', branch: 'rails4beta'

replace:

gem 'jquery-rails', '3.0.0'

with:

gem 'jquery-rails', '2.3.0'

and bundle install and run the rails generate active_admin:install to install.

Fire up the server, go to root_url/admin and you should see the admin login.

Marc
  • 4,546
  • 2
  • 29
  • 45
  • 1
    This worked for me, I also had a problem with the latest jquery-rails. But overcame this by specifying a version less than 3.0.0. – StuR May 30 '13 at 15:22
  • Great catch! Just created a new app and it looks like the 0.6.0 version of ActiveAdmin does not play well with jquery-rails 3.0.0. Updated my answer above to set jquery-rails to 2.3.0. – Marc Jun 03 '13 at 10:26
  • akashkamboj/active_admin using "check_box_checked?". This gone in rails 4 – chijin Jun 09 '13 at 20:43
  • 2
    This doesn't work for me. I get a conflict: `activeadmin (>= 0) ruby depends on actionpack (~> 4.0.0) ruby` but `inherited_resources (>= 0) ruby depends on actionpack (3.2.13)`. – iconoclast Aug 05 '13 at 16:45
  • 1
    After running rails g active_admin:install you need to run rails db:migrate before you can access /admin – thekindofme Sep 05 '13 at 06:51
  • Thank you mark for this nice overview in this messed up repo and documentation :) – Denny Mueller Jun 10 '14 at 19:21
  • When you say "For Rails 4.1 and 4.0 (according to the official github page)" could you please link the page you quote? Anyway `gem 'activeadmin', github: 'activeadmin'` is working for me. – Attilio Dec 20 '14 at 14:22
  • 1
    @Attilio - Updated per your request! – Marc Dec 20 '14 at 20:40
  • @Marc how about Rails 5? is inherited_resources required? – Andy Feb 24 '17 at 23:28
30

January 11, 2016 Updated answer

ActiveAdmin has now Rails 4 full support :

1.0.0 Version, full support of Rails 4) :

gem 'activeadmin', github: 'activeadmin'


0.6 Stable version (may not properly support Rails 4) :

gem 'activeadmin', github: 'activeadmin', branch: '0-6-stable'

Erowlin
  • 9,555
  • 4
  • 35
  • 63
0

I have switched to Ubuntu, and that resolved the issue I was having. For some reason, Windows chokes when trying to get a gem that is not on the Ruby source.

-1

Thanks for the help, Marc and Oto Brglez. A quick update for the rails 4 implementation. You do not need to use branch '0-6-stable' (that is the current branch as of today), you can instead just use the master branch as noted int he documentation on gregbell's github. https://github.com/gregbell/active_admin

Community
  • 1
  • 1
-1

Just edit your Gemfile. This all what you need to your ActiveAdmin 1.0.0 works properly with Rails 4.1


Add following lines:

gem 'activeadmin',      github: 'gregbell/active_admin'             # ActiveAdmin backend framework for Rails administration interface
gem 'polyamorous',      github: 'activerecord-hackery/polyamorous'  # Require for ActiveAdmin to work with Rails 4.1
gem 'ransack',          github: 'activerecord-hackery/ransack'      # Require for ActiveAdmin to work with Rails 4.1
gem 'formtastic',       github: 'justinfrench/formtastic'           # Require for ActiveAdmin to work with Rails 4.1
gem 'devise'                                                        # Authentication
dPanda13
  • 265
  • 1
  • 3
  • 9
  • dPanda13: Followed your steps but i'm getting this error when i start my server http://stackoverflow.com/questions/24902445/activeadmin-jquery-ui-rails-5-0-0-gem . Any idea ? – BC2 Jul 23 '14 at 05:30
  • dPanda13 Follow ur steps but i'm getting this error http://stackoverflow.com/questions/24902445/activeadmin-jquery-ui-rails-5-0-0-gem any idea ? – BC2 Jul 23 '14 at 05:37
  • 1
    This is no longer needed. – Timo Schilling Dec 15 '14 at 21:47