如何在Rails 4中安装rails_admin gem

时间:2016-03-28 15:11:46

标签: ruby-on-rails ruby rubygems rails-admin ruby-on-rails-4.2

我想安装RailsAdmin gem。当我运行bundle install时,我得到:

Bundler could not find compatible versions for gem "jquery-ui-rails": 
In Gemfile:
    jquery-ui-sass-rails was resolved to 4.0.3.0, which depends on
      jquery-ui-rails (= 4.0.3)

    rails_admin was resolved to 0.6.4, which depends on
      jquery-ui-rails (~> 5.0) Bundler could not find compatible versions for gem "rails":   In Gemfile:
    rails (= 4.2.4)

    rails_admin was resolved to 0.0.1, which depends on
      rails (~> 3.1) Bundler could not find compatible versions for gem "sass-rails":   In Gemfile:
    sass-rails (~> 5.0)

    rails_admin was resolved to 0.6.1, which depends on
      sass-rails (~> 4.0)

我尝试删除Gemfile.lock并重新bundle install,但它不起作用。

这是我的Gemfile:

source 'https://rubygems.org'


gem 'rails', '4.2.4'
gem 'mysql2', '~> 0.3.18'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'therubyracer', platforms: :ruby

gem 'jquery-rails'
gem 'fancybox2-rails'
gem "select2-rails"

gem 'jquery-ui-sass-rails'

gem 'momentjs-rails', '~> 2.10.2'

gem 'turbolinks'
gem 'jbuilder', '~> 2.0'

gem 'sdoc', '~> 0.4.0', group: :doc

gem 'bootstrap-sass', '~> 3.3.6'
gem 'bootstrap-material-design'

gem 'geocoder'
gem 'gmaps4rails'
gem 'chewy'

gem "font-awesome-rails"

gem 'cells'
gem 'cells-erb'

gem 'rails-i18n'
gem 'devise'
gem 'omniauth-twitter'
gem 'omniauth-facebook'
gem 'koala'

gem 'rails_admin'
gem 'rmagick'
gem 'carrierwave'
gem 'fog'
gem 'htmlentities'

#editor
gem "wysiwyg-rails"

gem 'pundit', github: 'elabs/pundit'

group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug'
end

group :development do
  # Access an IRB console on exception pages or by using <%= console %> in views
  gem 'web-console', '~> 2.0'

  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
end

我的Ruby和Rails版本是:

* Ruby 2.1.4p265 (2014-10-27 revision 48166) [i686-linux]
* Rails 4.2.4

如何修复这些错误?

1 个答案:

答案 0 :(得分:0)

请在这里结帐similar issue。希望能帮助到你。