Rails 4:activeadmin错误消息 - Bundler找不到gem“actionpack”的兼容版本

时间:2013-10-29 05:09:38

标签: ruby-on-rails-4 activeadmin

我想将activeadmin用于我的rails项目,因此我将其添加到 gemfile

 gem 'activeadmin'

并更新了捆绑包,但收到了此错误消息 -

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

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

我在github上传了这个项目;这是 gemfile - https://github.com/Mashpy/esl/blob/master/Gemfile

的链接
source 'https://rubygems.org'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.0'

# Use sqlite3 as the database for Active Record
gem 'sqlite3'

# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'

# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'

# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'

# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'

# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'

# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.2'

#gem
 gem 'activeadmin'

group :doc do
  # bundle exec rake doc:rails generates the API under doc/api.
  gem 'sdoc', require: false
end

我做错了什么阻止我添加activeadmin?

3 个答案:

答案 0 :(得分:5)

Active Admin还有一些其他依赖项。看看Active Admin install with Rails 4

将所有宝石(在最上面的答案中)复制并粘贴到您的gem文件中,运行bundle时不应该有任何问题。

答案 1 :(得分:4)

您可以使用 -

更新套装
bundle update

然后

bundle install

确保宝石的配置正确。

答案 2 :(得分:0)

我认为你应该升级这些宝石:

sass-rails ~> 3.2.3
coffee-rails ~> 3.2.1

参考文献:

http://guides.rubyonrails.org/3_2_release_notes.html