使用 Rails 4 进行主动管理员安装 [英] Active admin install with Rails 4

查看:15
本文介绍了使用 Rails 4 进行主动管理员安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Rails 4 上安装活动管理员时出现此错误

Bundler 找不到 gem "actionpack" 的兼容版本:在 Gemfile 中:meta_search (>= 1.1.0.pre) ruby​​ 依赖动作包 (~> 3.1.0.alpha) 红宝石rails (= 4.0.0.rc1) ruby​​ 依赖动作包 (4.0.0.rc1)

我遵循以下说明:http://www.activeadmin.info/docs/documentation.html

请任何人帮忙.

解决方案

2015 年 4 月 20 日更新

对于 Rails 4(根据官方 github 页面)使用任一主控:

gem 'activeadmin', github: 'activeadmin'

或者红宝石:

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

2015 年 2 月 14 日更新

对于 Rails 4(根据官方 github 页面)使用:

gem 'activeadmin', github: 'activeadmin'

2014 年 9 月 4 日更新

对于 Rails 4.0 和 4.1(根据官方 github 页面)使用:

gem 'activeadmin', github: 'activeadmin'

2014 年 4 月 24 日更新

对于 Rails 4.1 和 4.0 使用 master:

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

2014 年 4 月 13 日更新

对于 Rails 4.1 使用 master 和以下依赖分支:

gem 'activeadmin', github: 'gregbell/active_admin'gem 'polyamorous',github:'activerecord-hackery/polyamorous'gem 'ransack',github:'activerecord-hackery/ransack'gem'formtastic',github:'justinfrench/formtastic'

对于 Rails 4.0.X,只需使用 master 即可:

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

注意:在 Rails 4.1 中向索引页添加注释存在问题.正在此处跟踪此问题.

2013 年 9 月 29 日更新

Rails 4 分支已合并到 master.现在您需要做的就是指定:

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

2013 年 8 月 28 日更新答案

能够使用 AA 构建一个新的 Rails 4 应用程序并运行:

gem 'activeadmin',github:'gregbell/active_admin',分支:'rails4'

请忽略旧的答案.只需将此行添加到您的新 Rails 4 应用 Gemfile,运行 bundle install,运行 rails g active_admin:install,运行 rake db:migrate,运行 bundle exec rails s,转到 /admin,然后使用 admin@example.com/password 登录,您就可以开始了!有关详细信息,请参阅 ActiveAdmin 文档.

2013 年 6 月 30 日更新答案

在为 Rails 4 准备好 ActiveAdmin 和它所依赖的 gem 方面取得了很大进展.请使用以下 gemfile 设置并忽略有关将 jquery-rails 降级到 2.3.0 的部分:

gem 'devise', github: 'plataformatec/devise'gem'响应者',github:'plataformatec/responders'gem'inherited_resources',github:'josevalim/inherited_resources'gem 'ransack',github:'ernie/ransack'gem 'activeadmin',github:'gregbell/active_admin',分支:'rails4'gem'formtastic',github:'justinfrench/formtastic'

只需bundle install(或bundle update,如有必要)并运行rails generate active_admin:install(如有必要)进行安装<小时>

原答案

我使用以下命令让我的 Rails 4.0.0.rc1/JRuby/Puma 应用程序上的 ActiveAdmin 启动并在 Heroku 上运行.

从 ActiveAdmin github 中查看以下链接后:

Re:Rails 4 问题 - 问题 #1963

Rails 4 Hacks, Fixes - Pull Request #2120

我在我的 gemfile 中添加了以下内容:

gem 'devise',github:'plataformatec/devise',分支:'rails4'gem'响应者',github:'plataformatec/responders'gem'inherited_resources',github:'josevalim/inherited_resources'gem 'ransack',github:'ernie/ransack'gem 'activeadmin',github:'akashkamboj/active_admin',分支:'rails4'gem 'formtastic',github:'justinfrench/formtastic',分支:'rails4beta'

替换:

gem 'jquery-rails', '3.0.0'

与:

gem 'jquery-rails', '2.3.0'

bundle install并运行rails generate active_admin:install来安装.

启动服务器,转到 root_url/admin,您应该会看到管理员登录.

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.

解决方案

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.

这篇关于使用 Rails 4 进行主动管理员安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆