Gem文件问题

时间:2015-12-22 16:39:06

标签: ruby-on-rails ruby gem activeadmin

我正在尝试安装我部分成功的主动管理员。但是,我想使用' 0-6-stable'而不是" 1.0.0.pre2"版。当我更改我的gem文件以反映我的更改时,我收到以下错误消息:

Resolving dependencies...
Bundler could not find compatible versions for gem "formtastic":
  In Gemfile:
    activeadmin (>= 0) ruby depends on
      formtastic (~> 2.0) ruby

    formtastic (3.2.0.pre)

现在,我之前收到了此消息,我只是删除了我的Gemfile.lock,但它似乎并没有起作用。

我的宝石文件的副本:

source 'http://rubygems.org'

ruby '2.2.1'
gem 'ransack', github: 'activerecord-hackery/ransack'
gem 'inherited_resources', github: 'josevalim/inherited_resources'
gem 'formtastic',          github: 'justinfrench/formtastic'
gem 'rails', '~> 4.2', '>= 4.2.5'
gem 'railties', '~> 4.2', '>= 4.2.5'
gem 'sqlite3', group: :development
gem 'sass-rails', '~> 4.0.3'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails', '~> 4.0', '>= 4.0.5'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0',          group: :doc
gem 'rails_12factor', group: :production
gem 'pg', group: :production
gem 'activeadmin', github: 'activeadmin', branch: '0-6-stable'
#gem 'will_paginate', '~> 3.0'
#gem 'will_paginate-bootstrap'
gem 'carrierwave'
gem "fog"
gem "figaro"
gem 'execjs'
gem 'tzinfo-data', platforms: [:mingw, :mswin]
gem "mini_magick"
gem 'devise'
gem 'searchkick'
group :development, :test do
  gem 'rspec-rails', '~> 3.0'
end

我想使用最稳定版本的有效管理员的原因是因为我在选择"管理员用户"时获得了"NoMethodError in Admin::AdminUsersController#index"。我希望使用稳定版本可以解决这个问题。

编辑:ActiveAdmin问题:https://github.com/activeadmin/activeadmin/issues/4249

2 个答案:

答案 0 :(得分:1)

如果您使用导轨0-6-stable,则无法使用>= 4.x分支,0-6-stable仅适用于导轨<= 3.x

这意味着你的Gemfile需要看起来像这样:     来源'http://rubygems.org'

ruby '2.2.1'
gem 'rails', '~> 4.2', '>= 4.2.5'
gem 'railties', '~> 4.2', '>= 4.2.5'
gem 'sqlite3', group: :development
gem 'sass-rails', '~> 4.0.3'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails', '~> 4.0', '>= 4.0.5'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0',          group: :doc
gem 'rails_12factor', group: :production
gem 'pg', group: :production
gem 'activeadmin', github: 'activeadmin'
#gem 'will_paginate', '~> 3.0'
#gem 'will_paginate-bootstrap'
gem 'carrierwave'
gem "fog"
gem "figaro"
gem 'execjs'
gem 'tzinfo-data', platforms: [:mingw, :mswin]
gem "mini_magick"
gem 'devise'
gem 'searchkick'
group :development, :test do
  gem 'rspec-rails', '~> 3.0'
end

从ActiveAdmin的角度来看,不需要从github使用ransack,inherited_resources和formtastic。

答案 1 :(得分:-1)

1:删除 Gemfile.lock

2:添加gem 'jquery-rails'

3:添加gem 'formtastic'

4:运行bundle install

如果您在捆绑Github Active Admin中遇到任何问题,我仍然想说rails 3.2

希望这能帮到你!!!