使用Rails 4进行主动管理员安装 [英] Active admin install with Rails 4
问题描述
在Rails 4上安装活动管理员时出现此错误
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)
我遵循以下说明:
http://www.activeadmin.info/docs/documentation.html
请任何人帮助。
推荐答案
4月2015年20日更新
对于Rails 4(根据官方github页面)使用任一主菜单:
For Rails 4 (according to the official github page) use either master:
gem 'activeadmin', github: 'activeadmin'
或红宝石:
gem 'activeadmin', '~> 1.0.0.pre1'
2015年2月14日更新
对于Rails 4(根据官方github页面)使用:
For Rails 4 (according to the official github page) use:
gem 'activeadmin', github: 'activeadmin'
2014年9月4日更新
对于Rails 4.0和4.1(根据官方github页面)使用:
For Rails 4.0 and 4.1 (according to the official github page) use:
gem 'activeadmin', github: 'activeadmin'
2014年4月24日更新
对于Rails 4.1和4.0,请使用master:
For Rails 4.1 and 4.0 use master:
gem 'activeadmin', github: 'gregbell/active_admin'
2014年4月13日更新
对于Rails 4.1,请使用master和以下依赖项分支:
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'
对于Rails 4.0.X,只需使用master,就可以了:
For Rails 4.0.X just use master and you should be good to go:
gem 'activeadmin', github: 'gregbell/active_admin'
注意:在Rails 4.1的索引页中添加注释存在一个问题。正在此处进行跟踪。
Note: There's an issue with adding comments to the index page in Rails 4.1. This issue is being tracked here.
2013年9月29日更新
Rails 4分支已合并为master。现在,您只需指定:
The Rails 4 branch has been merged into master. Now all you need to do is specify:
gem 'activeadmin', github: 'gregbell/active_admin'
2013年8月28日更新的答案
仅使用以下命令就能构建并运行AA的新Rails 4应用程序:
Was able to build a new rails 4 app up and running with AA just using:
gem 'activeadmin', github: 'gregbell/active_admin', branch: 'rails4'
请忽略较旧的答案。只需将此行添加到新的Rails 4应用程序Gemfile中,运行捆绑安装,运行 rails g active_admin:install ,运行 rake db:migrate ,运行 bundle exec rails ,转到 / admin ,然后使用 admin@example.com/password 登录,您很高兴!有关更多详细信息,请参见 ActiveAdmin文档。
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.
六月2013年30月30日更新了答案
在获得ActiveAdmin及其依赖于Rails 4的gem方面已经取得了很多进展。请使用以下gemfile设置和忽略有关将jquery-rails降级到2.3.0的内容:
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'
只需捆绑安装
(或捆绑更新
) )并运行 rails生成active_admin:install
(如果n安装)
just bundle install
(or bundle update
, if necessary) and run rails generate active_admin:install
(if necessary) to install
原始答案
我使用以下命令在Rails 4.0.0.rc1 / JRuby / Puma应用程序上启动ActiveAdmin并在Heroku上运行。
I used the following to get ActiveAdmin on my Rails 4.0.0.rc1/JRuby/Puma app up and running on Heroku.
在检查了以下内容之后来自ActiveAdmin github的链接:
After checking out the following links from the ActiveAdmin github:
Rails 4 Hacks,Fixes-Pull请求#2120
我在我的gemfile中添加了以下内容:
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'
带有:
gem 'jquery-rails', '2.3.0'
和捆绑安装
并运行 rails生成active_admin:install
进行安装。
启动服务器,转到root_url / admin,您应该看到管理员登录。
Fire up the server, go to root_url/admin and you should see the admin login.
这篇关于使用Rails 4进行主动管理员安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!